mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
tsdemux: Emit no-more-pads when all pads are activated
Fixes #670921 again
This commit is contained in:
parent
94f370c7d7
commit
fa4b92e743
1 changed files with 14 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue