Filesrc dont play when connect to audiomixer dinamicaly.

Tim Müller tim at centricular.com
Tue Nov 10 01:07:59 PST 2015


On Mon, 2015-11-09 at 23:07 -0800, _dmp wrote:

Hi,

> I wish to dynamically connect filesrc to play the file to an existing
> conveyer but I have no play wav file at all. 
> 
> So static pipeline looks like this:
> 
> alsasrc ! audiomixer ! alsasink
> 
> I dinamically create bin and connect his to audiomixer
> 
> fileplaybin:  filesrc ! wavparse ! capsfilter ->to "audiomixer"
> 
> I connect the probe to the point "capsfilter:src", to expect EOS (to
> control the end of file playback). 
> Immediately after the start "fileplaybin" I get the EOS and the file
> does not play.
> If I connect "fileplaybin" to "alsasink"(I mean clean connect without
> "alsasrc" and "audiomixer") - file is played normally. The problem is
> in the dynamic connection chains "filesrc" to an existing pipeline.
> What could be the problem and where do I look?

wavparse will create a GstSegment + timestamps starting from 0.

It doesn't know that your other branch (alsasrc ! audiomixer !
alsasink) has been playing for a while already.

So if after some time you hook up that wavparse branch to audiomixer,
audiomixer will see timestamps (converted to running time) which are
already in the past from its perspective, so it will just throw away
all input buffers (or some, if you haven't playing that long yet).

You can use

  gst_pad_set_offset (pad, time_already_playing);

to shift the timeline of the newly-added branch.

Cheers
 -Tim

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




More information about the gstreamer-devel mailing list