diff options
author | Edward Hervey <bilboed@bilboed.com> | 2009-03-09 15:09:10 +0100 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2009-03-09 15:09:10 +0100 |
commit | 146aab9dcb6016303503a35483cb7b7d6a4f242f (patch) | |
tree | 4d3d420ed7e19ef4b57ad7844458bb742605ab16 | |
parent | f8e3a0007f0dd14135820e802c8e68d835a8a747 (diff) |
demux: If the demuxer isn't initialized yet, forward serialized events without waiting.
We do this, because the demuxer is initialized in the loop function. If it's not
initialized yet, that means the loop hasn't been entered... and therefore the
PIPE GCond will never be signalled.
-rw-r--r-- | ext/ffmpeg/gstffmpegdemux.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/ffmpeg/gstffmpegdemux.c b/ext/ffmpeg/gstffmpegdemux.c index cc99f0b..ae0caf6 100644 --- a/ext/ffmpeg/gstffmpegdemux.c +++ b/ext/ffmpeg/gstffmpegdemux.c @@ -1515,6 +1515,8 @@ gst_ffmpegdemux_sink_event (GstPad * sinkpad, GstEvent * event) demux = (GstFFMpegDemux *) (GST_PAD_PARENT (sinkpad)); ffpipe = &(demux->ffpipe); + GST_DEBUG_OBJECT (demux, "event %s", GST_EVENT_TYPE_NAME (event)); + switch (GST_EVENT_TYPE (event)) { case GST_EVENT_FLUSH_START: /* forward event */ @@ -1557,8 +1559,11 @@ gst_ffmpegdemux_sink_event (GstPad * sinkpad, GstEvent * event) goto done; default: /* for a serialized event, wait until an earlier data is gone, - * though this is no guarantee as to when task is done with it */ - if (GST_EVENT_IS_SERIALIZED (event)) { + * though this is no guarantee as to when task is done with it. + * + * If the demuxer isn't opened, push straight away, since we'll + * be waiting against a cond that will never be signalled. */ + if (GST_EVENT_IS_SERIALIZED (event) && demux->opened) { GST_FFMPEG_PIPE_MUTEX_LOCK (ffpipe); while (!ffpipe->needed) GST_FFMPEG_PIPE_WAIT (ffpipe); |