summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@collabora.com>2012-05-18 10:07:56 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-05-18 11:11:25 +0200
commitfa4b92e743fa7850cee330143aa727818dc2f56e (patch)
tree00fcdb3c7544571f765ee7c740fc5e5c866b4835
parent94f370c7d7ecd8d0e20b52ed53f0dcdc267af3b2 (diff)
tsdemux: Emit no-more-pads when all pads are activated
Fixes #670921 again
-rw-r--r--gst/mpegtsdemux/tsdemux.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c
index 647611e2c..b7cd0aa28 100644
--- a/gst/mpegtsdemux/tsdemux.c
+++ b/gst/mpegtsdemux/tsdemux.c
@@ -992,12 +992,26 @@ gst_ts_demux_stream_removed (MpegTSBase * base, MpegTSBaseStream * bstream)
static void
activate_pad_for_stream (GstTSDemux * tsdemux, TSDemuxStream * stream)
{
+ GList *tmp;
+ gboolean alldone = TRUE;
+
if (stream->pad) {
GST_DEBUG_OBJECT (tsdemux, "Activating pad %s:%s for stream %p",
GST_DEBUG_PAD_NAME (stream->pad), stream);
gst_element_add_pad ((GstElement *) tsdemux, stream->pad);
stream->active = TRUE;
GST_DEBUG_OBJECT (stream->pad, "done adding pad");
+
+ /* Check if all pads were activated, and if so emit no-more-pads */
+ for (tmp = tsdemux->program->stream_list; tmp; tmp = tmp->next) {
+ stream = (TSDemuxStream *) tmp->data;
+ if (stream->pad && !stream->active)
+ alldone = FALSE;
+ }
+ if (alldone) {
+ GST_DEBUG_OBJECT (tsdemux, "All pads were activated, emit no-more-pads");
+ gst_element_no_more_pads ((GstElement *) tsdemux);
+ }
} else
GST_WARNING_OBJECT (tsdemux,
"stream %p (pid 0x%04x, type:0x%03x) has no pad", stream,