Seamless playback without playbin

Tim-Philipp Müller t.i.m at zen.co.uk
Sat Aug 31 06:16:22 PDT 2013


On Sat, 2013-08-31 at 00:36 +0200, marcin at saepia.net wrote:

Hi,

> I have pipeline with two branches, and I need to switch them
> dynamically without any gaps.
> 
> 
> Each branch is basically
> 
> 
> filesrc -> decodebin -> audioresample -> audioconvert -> capsfilter
> 
> 
> put in a bin where bin's src ghost pad is made out of capsfilter's src
> pad.
> 
> 
> I have EVENT_BOTH pad probe on capsfilter's src pad and I listen for
> EOS.
> 
> When EOS happens, another branch is always prepared for playback, I
> mean it is in PLAYING state but bin's src pad is blocked.
> 
> 
> In callback for EOS I immediately unlink EOSed bin, link another one
> and remove blocking pad probe for the newly linked branch.
> 
> 
> Sound plays, but there are tiny gaps between files.
> 
> What else should I do in order to achieve gapless playback?

What are your input files? Have you tried with .wav files?

Encoded files may introduce coding-related gaps. Sometimes those are
tagged somewhere, sometimes not. I don't think we handle this yet.

http://wiki.hydrogenaudio.org/index.php?title=Gapless_playback

has some info in case you're interested.

I believe rhythmbox implements cross-fading outside of playbin, which
might be interesting code to look at for inspiration, if it works.

 Cheers
  -Tim




More information about the gstreamer-devel mailing list