diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-03-24 15:23:03 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-03-24 15:23:03 +0100 |
commit | 6b2c55e254a27c0caca19e00f7c1afa8047dbd69 (patch) | |
tree | 5be4a35269a88077e56b5bdc19550ed1a46f1243 /gst/selector | |
parent | c28c21d06fbc8b17e8a09f08148af29cb721ce0f (diff) | |
download | gst-plugins-bad-6b2c55e254a27c0caca19e00f7c1afa8047dbd69.tar.gz gst-plugins-bad-6b2c55e254a27c0caca19e00f7c1afa8047dbd69.tar.bz2 gst-plugins-bad-6b2c55e254a27c0caca19e00f7c1afa8047dbd69.zip |
selector: merge the tags
Merge the tags received on the input-selector sinkpads instead of only keeping
the last one we saw.
Diffstat (limited to 'gst/selector')
-rw-r--r-- | gst/selector/gstinputselector.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gst/selector/gstinputselector.c b/gst/selector/gstinputselector.c index ec1ae542..7a458b0f 100644 --- a/gst/selector/gstinputselector.c +++ b/gst/selector/gstinputselector.c @@ -402,16 +402,18 @@ gst_selector_pad_event (GstPad * pad, GstEvent * event) } case GST_EVENT_TAG: { - GstTagList *tags; + GstTagList *tags, *oldtags, *newtags; - GST_OBJECT_LOCK (selpad); - if (selpad->tags) - gst_tag_list_free (selpad->tags); gst_event_parse_tag (event, &tags); - if (tags) - tags = gst_tag_list_copy (tags); - selpad->tags = tags; - GST_DEBUG_OBJECT (pad, "received tags %" GST_PTR_FORMAT, selpad->tags); + + GST_OBJECT_LOCK (selpad); + oldtags = selpad->tags; + + newtags = gst_tag_list_merge (oldtags, tags, GST_TAG_MERGE_REPLACE); + selpad->tags = newtags; + if (oldtags) + gst_tag_list_free (oldtags); + GST_DEBUG_OBJECT (pad, "received tags %" GST_PTR_FORMAT, newtags); GST_OBJECT_UNLOCK (selpad); break; } |