After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 599478 - Make track switches faster with playbin2
Make track switches faster with playbin2
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: GStreamer backend
2.28.x
Other Linux
: Normal normal
: ---
Assigned To: Maintainer alias for GStreamer component of Totem
Maintainer alias for GStreamer component of Totem
Depends on:
Blocks:
 
 
Reported: 2009-10-24 11:45 UTC by Sebastian Dröge (slomo)
Modified: 2009-11-23 07:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Only set playbin2 to NULL on errors or after 10 seconds of doing nothing (3.92 KB, patch)
2009-11-14 15:54 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2009-10-24 11:45:27 UTC
Hi,
there are some possibilities for improvement how totem handles different tracks with playbin2.

1) totem should really use playbin2's about-to-finish signal to select the next track after the current one has finished. This is done by connecting to about-to-finish and setting the "uri"/"suburi" properties of playbin2 to the next track. After the current one has finished it will immediately switch to the next one

2) totem should *never* set the state of playbin2 to NULL between different tracks, READY is good enough. And only setting to READY will make track switches (when a new track is selected to be played *now* during playback) much faster. It should just do a) set new URI, b) set state to READY, c) set state to PLAYING again.
The problem of opened audio device forever can be fixed as it was done in banshee: g_timeout_add(10, ...) and set playbin2 to NULL from the callback if no new track was selected to be played. And of course before unreffing playbin2 it must be set to NULL.
Comment 1 Bastien Nocera 2009-11-12 12:10:13 UTC
If we go down the route of 1), then see also https://bugzilla.gnome.org/show_bug.cgi?id=601524
Comment 2 Sebastian Dröge (slomo) 2009-11-14 15:54:44 UTC
Created attachment 147730 [details] [review]
Only set playbin2 to NULL on errors or after 10 seconds of doing nothing

This makes track switches faster and prevents useless state changes.

Setting playbin2 to NULL after 10 seconds of idle is a good idea to
close any audio devices.

See bug #599478.
Comment 3 Sebastian Dröge (slomo) 2009-11-14 15:56:29 UTC
The patch in comment #2 implements 2). Works great but I should probably mention that this will *never* set playbin2's state to NULL because totem always starts the first track in the playlist paused.
Comment 4 Sebastian Dröge (slomo) 2009-11-14 16:06:44 UTC
(In reply to comment #3)
> The patch in comment #2 implements 2). Works great but I should probably
> mention that this will *never* set playbin2's state to NULL because totem
> always starts the first track in the playlist paused.

Never was a bit too hard... if the playlist is empty it will go to NULL (after 10 seconds with my patch). Still, I don't think that behaviour is a good idea.
Comment 5 Sebastian Dröge (slomo) 2009-11-23 07:05:27 UTC
Let's close this one, the second part is implemented and already provides a great improvement. Bug #602691 is for the gapless feature now, this has to wait until it's fixed in playbin2 though.