matroska-demux: Send pending tags when adding a new pad

We might've parsed those tags before already and tried to push them to
non-existing pads before. Now let's do it for real.
This commit is contained in:
Sebastian Dröge 2015-04-28 15:42:49 +02:00
parent 73c0c2920f
commit 9119fbd774

View file

@ -1240,6 +1240,29 @@ gst_matroska_demux_add_stream (GstMatroskaDemux * demux, GstEbmlRead * ebml)
gst_pad_push_event (context->pad, stream_start);
gst_pad_set_caps (context->pad, context->caps);
if (demux->common.global_tags) {
GstEvent *tag_event;
gst_tag_list_add (demux->common.global_tags, GST_TAG_MERGE_REPLACE,
GST_TAG_CONTAINER_FORMAT, "Matroska", NULL);
GST_DEBUG_OBJECT (context->pad, "Sending global_tags %p: %" GST_PTR_FORMAT,
demux->common.global_tags, demux->common.global_tags);
tag_event =
gst_event_new_tag (gst_tag_list_copy (demux->common.global_tags));
gst_pad_push_event (context->pad, tag_event);
}
if (G_UNLIKELY (context->tags_changed)) {
GST_DEBUG_OBJECT (context->pad, "Sending tags %p: %"
GST_PTR_FORMAT, context->tags, context->tags);
gst_pad_push_event (context->pad,
gst_event_new_tag (gst_tag_list_copy (context->tags)));
context->tags_changed = FALSE;
}
gst_element_add_pad (GST_ELEMENT (demux), context->pad);
gst_flow_combiner_add_pad (demux->flowcombiner, context->pad);