mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
tagdemux: Use upstream GST_EVENT_STREAM_START if present
If we have an upstream GST_EVENT_STREAM_START, use that one instead of creating a new one which could be completely different from the upstream one and drop information (like the stream flags and stream object). Only create a new event if we don't already have one from upstream https://bugzilla.gnome.org/show_bug.cgi?id=797215
This commit is contained in:
parent
2c44c5fb40
commit
8707914d23
1 changed files with 8 additions and 19 deletions
|
@ -339,10 +339,6 @@ gst_tag_demux_set_src_caps (GstTagDemux * tagdemux, GstCaps * new_caps)
|
||||||
|
|
||||||
if (old_caps == NULL || !gst_caps_is_equal (new_caps, old_caps)) {
|
if (old_caps == NULL || !gst_caps_is_equal (new_caps, old_caps)) {
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
guint group_id;
|
|
||||||
gboolean have_group_id;
|
|
||||||
gchar *stream_id = gst_pad_create_stream_id (tagdemux->priv->srcpad,
|
|
||||||
GST_ELEMENT_CAST (tagdemux), NULL);
|
|
||||||
|
|
||||||
gst_caps_replace (&tagdemux->priv->src_caps, new_caps);
|
gst_caps_replace (&tagdemux->priv->src_caps, new_caps);
|
||||||
|
|
||||||
|
@ -352,23 +348,16 @@ gst_tag_demux_set_src_caps (GstTagDemux * tagdemux, GstCaps * new_caps)
|
||||||
event =
|
event =
|
||||||
gst_pad_get_sticky_event (tagdemux->priv->sinkpad,
|
gst_pad_get_sticky_event (tagdemux->priv->sinkpad,
|
||||||
GST_EVENT_STREAM_START, 0);
|
GST_EVENT_STREAM_START, 0);
|
||||||
if (event) {
|
if (!event) {
|
||||||
if (gst_event_parse_group_id (event, &group_id))
|
gchar *stream_id = gst_pad_create_stream_id (tagdemux->priv->srcpad,
|
||||||
have_group_id = TRUE;
|
GST_ELEMENT_CAST (tagdemux), NULL);
|
||||||
else
|
GST_DEBUG_OBJECT (tagdemux, "Creating new STREAM_START event");
|
||||||
have_group_id = FALSE;
|
event = gst_event_new_stream_start (stream_id);
|
||||||
gst_event_unref (event);
|
g_free (stream_id);
|
||||||
} else {
|
gst_event_set_group_id (event, gst_util_group_id_next ());
|
||||||
have_group_id = TRUE;
|
|
||||||
group_id = gst_util_group_id_next ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event = gst_event_new_stream_start (stream_id);
|
|
||||||
if (have_group_id)
|
|
||||||
gst_event_set_group_id (event, group_id);
|
|
||||||
|
|
||||||
gst_pad_push_event (tagdemux->priv->srcpad, event);
|
gst_pad_push_event (tagdemux->priv->srcpad, event);
|
||||||
g_free (stream_id);
|
|
||||||
gst_pad_set_caps (tagdemux->priv->srcpad, tagdemux->priv->src_caps);
|
gst_pad_set_caps (tagdemux->priv->srcpad, tagdemux->priv->src_caps);
|
||||||
} else {
|
} else {
|
||||||
/* Caps never changed */
|
/* Caps never changed */
|
||||||
|
|
Loading…
Reference in a new issue