input-selector: Hold pad object lock when changing tags
authorJan Schmidt <jan@centricular.com>
Fri, 11 Apr 2014 12:38:25 +0000 (22:38 +1000)
committerJan Schmidt <jan@centricular.com>
Fri, 11 Apr 2014 12:39:36 +0000 (22:39 +1000)
Avoid spurious crashes when tags are retrieved just as
new ones arrive.

plugins/elements/gstinputselector.c

index 8fd9e59..45db79b 100644 (file)
@@ -506,10 +506,13 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event)
 
       gst_event_parse_tag (event, &tags);
 
+      GST_OBJECT_LOCK (selpad);
       oldtags = selpad->tags;
 
       newtags = gst_tag_list_merge (oldtags, tags, GST_TAG_MERGE_REPLACE);
       selpad->tags = newtags;
+      GST_OBJECT_UNLOCK (selpad);
+
       if (oldtags)
         gst_tag_list_unref (oldtags);
       GST_DEBUG_OBJECT (pad, "received tags %" GST_PTR_FORMAT, newtags);