Dynamically replacing uridecodebin

Tim Müller tim at centricular.com
Wed Oct 1 16:23:27 PDT 2014


On Wed, 2014-10-01 at 22:20 +0200, A. Bikadorov wrote:

Hi,

> I need some 'best practice' advice on how to replace an uridecodebin for the current
> playing song with a new one for the next song to achieve gapless playback (as much as
> possible).

Are you aware that playbin supports gapless playback via the
"about-to-finish" signal?

 Cheers
  -Tim

> The pipeline is simplified
> [ [uridecodebin] -> [audiobin] ]
> with a queue as first element in audiobin.
> 
> I know the uridecodebin can be replaced in the callback for the "drained" signal, and this
> what I came up with so far:
> - creating a new uridecodebin and setting the uri
> - removing the old uridecodebin and adding the new one to the pipeline
> - setting it to the "play" state
> - the bins are linked together in the "pad-added" callback
> 
> But this raises some issues:
> - The next song is played from the position where the old one ended, i.e. the clock is set
> the clock of the pipeline. This is also stated in the docs [1].
> - Seeking is not possible anymore after the bin was replaced. As a workaround all changes
> have to be reverted
> - I couldn't find a signal that is send when the transition to the next song is done to
> notify the application
> 
> Hope, someone can tell me the general approach for this. Or link to code where this is
> done, I assume it's not an odd use case.
> 
> Thanks!
> Alex
> 
> [1]:
> http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-dynamic-pipelines.html
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com



More information about the gstreamer-devel mailing list