<div dir="ltr"><div><div>Hi,<br><br></div><div>thanks for quick answer.<br></div><div><br>Is there any way to buffer this gap?<br><br></div>I mean that if I have filesrc + decoder it can read/decode data much faster than they are played back by the soundcard. So if I understand GStreamer logic correctly, it should be possible to have buffer that plays back audio at constant pace, and even if these two decoders switch and have gap for a few milliseconds, queue will continue sending buffered data without gap, and the gap itself will be filled when new branch is finally attached and decoder will pass through the delays introduced by codec, shouldn't it?<br>

<br>I tried to achieve something like this, with no sucess, so I am not sure if it is entirely possible with GStreamer?<br><br></div><div>If such precise joining two tracks is not possible right now, how gnonlin handles this rather often case in non-linear editing? Could gnonlin's code  be a possible source of inspiration for me?<br>

<br></div><div>Thanks,<br><br>m.<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/31 Tim-Philipp Müller <span dir="ltr"><<a href="mailto:t.i.m@zen.co.uk" target="_blank">t.i.m@zen.co.uk</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Sat, 2013-08-31 at 00:36 +0200, <a href="mailto:marcin@saepia.net">marcin@saepia.net</a> wrote:<br>

<br>
Hi,<br>
<br>
> I have pipeline with two branches, and I need to switch them<br>
> dynamically without any gaps.<br>
><br>
><br>
> Each branch is basically<br>
><br>
><br>
> filesrc -> decodebin -> audioresample -> audioconvert -> capsfilter<br>
><br>
><br>
> put in a bin where bin's src ghost pad is made out of capsfilter's src<br>
> pad.<br>
><br>
><br>
> I have EVENT_BOTH pad probe on capsfilter's src pad and I listen for<br>
> EOS.<br>
><br>
> When EOS happens, another branch is always prepared for playback, I<br>
> mean it is in PLAYING state but bin's src pad is blocked.<br>
><br>
><br>
> In callback for EOS I immediately unlink EOSed bin, link another one<br>
> and remove blocking pad probe for the newly linked branch.<br>
><br>
><br>
> Sound plays, but there are tiny gaps between files.<br>
><br>
> What else should I do in order to achieve gapless playback?<br>
<br>
</div>What are your input files? Have you tried with .wav files?<br>
<br>
Encoded files may introduce coding-related gaps. Sometimes those are<br>
tagged somewhere, sometimes not. I don't think we handle this yet.<br>
<br>
<a href="http://wiki.hydrogenaudio.org/index.php?title=Gapless_playback" target="_blank">http://wiki.hydrogenaudio.org/index.php?title=Gapless_playback</a><br>
<br>
has some info in case you're interested.<br>
<br>
I believe rhythmbox implements cross-fading outside of playbin, which<br>
might be interesting code to look at for inspiration, if it works.<br>
<br>
 Cheers<br>
  -Tim<br>
<br>
<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br></div>