From a89789366f899789f966ea98188b171e9fa58975 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 11 Apr 2014 22:38:25 +1000 Subject: [PATCH] input-selector: Hold pad object lock when changing tags Avoid spurious crashes when tags are retrieved just as new ones arrive. --- plugins/elements/gstinputselector.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c index 8fd9e59d17..45db79bd8a 100644 --- a/plugins/elements/gstinputselector.c +++ b/plugins/elements/gstinputselector.c @@ -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);