mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
selector: merge the tags
Merge the tags received on the input-selector sinkpads instead of only keeping the last one we saw.
This commit is contained in:
parent
c28c21d06f
commit
6b2c55e254
1 changed files with 10 additions and 8 deletions
|
@ -402,16 +402,18 @@ gst_selector_pad_event (GstPad * pad, GstEvent * event)
|
||||||
}
|
}
|
||||||
case GST_EVENT_TAG:
|
case GST_EVENT_TAG:
|
||||||
{
|
{
|
||||||
GstTagList *tags;
|
GstTagList *tags, *oldtags, *newtags;
|
||||||
|
|
||||||
|
gst_event_parse_tag (event, &tags);
|
||||||
|
|
||||||
GST_OBJECT_LOCK (selpad);
|
GST_OBJECT_LOCK (selpad);
|
||||||
if (selpad->tags)
|
oldtags = selpad->tags;
|
||||||
gst_tag_list_free (selpad->tags);
|
|
||||||
gst_event_parse_tag (event, &tags);
|
newtags = gst_tag_list_merge (oldtags, tags, GST_TAG_MERGE_REPLACE);
|
||||||
if (tags)
|
selpad->tags = newtags;
|
||||||
tags = gst_tag_list_copy (tags);
|
if (oldtags)
|
||||||
selpad->tags = tags;
|
gst_tag_list_free (oldtags);
|
||||||
GST_DEBUG_OBJECT (pad, "received tags %" GST_PTR_FORMAT, selpad->tags);
|
GST_DEBUG_OBJECT (pad, "received tags %" GST_PTR_FORMAT, newtags);
|
||||||
GST_OBJECT_UNLOCK (selpad);
|
GST_OBJECT_UNLOCK (selpad);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue