[gst-devel] Why auido and video can not play at the same time?

René Stadler mail at renestadler.de
Wed May 23 07:44:12 CEST 2007


Am Mittwoch, den 23.05.2007, 13:09 +0800 schrieb gtxia:
> Hello all.
> 
> I developed a application to play avi (video is xvid and audio is
> mp3)file. Use the define to only play video or audio or all. When play
> only video or audio, this application is OK. But when I want to use it
> to play all. It seems deadlock. I don't know how to solve this problem.
> Thanks for any help.
> 
> The application codes:
> 

<snip code>

Add queue elements after your demuxer, one for audio and one for the
video part.  The problem you face is that when the first sink has enough
data, it blocks while waiting for the pipeline to go from PAUSED to the
PLAYING state.  This makes the demuxer block while trying to push more
data into the first sink, which keeps it from pushing any more data --
in particular to the second sink.  Therefore, the second sink never gets
enough data to reach the PAUSED state (finish "preroll"), which is why
playing can never start.

Adding a queue solves this problem because it adds an additional thread,
which decouples the data flow.

-- 
Regards,
  René Stadler





More information about the gstreamer-devel mailing list