GNOME Bugzilla – Bug 599478
Make track switches faster with playbin2
Last modified: 2009-11-23 07:05: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.
If we go down the route of 1), then see also https://bugzilla.gnome.org/show_bug.cgi?id=601524
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.
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.
(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.
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.