From 42fab9db45665b1d7ca80e889cfa0b3e7368cd0b Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Thu, 21 Jun 2012 01:28:43 -0300 Subject: [PATCH] inputselector: avoid notify-tags holding lock unlock before issuing this notification to prevent deadlocks when other elements reacts to new tags. Fixes #678220 --- plugins/elements/gstinputselector.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c index c2552e7081..a0ed632e70 100644 --- a/plugins/elements/gstinputselector.c +++ b/plugins/elements/gstinputselector.c @@ -454,6 +454,7 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event) { gboolean res = TRUE; gboolean forward; + gboolean new_tags = FALSE; GstInputSelector *sel; GstSelectorPad *selpad; GstPad *prev_active_sinkpad; @@ -524,7 +525,7 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event) gst_tag_list_unref (oldtags); GST_DEBUG_OBJECT (pad, "received tags %" GST_PTR_FORMAT, newtags); - g_object_notify (G_OBJECT (selpad), "tags"); + new_tags = TRUE; break; } case GST_EVENT_EOS: @@ -551,6 +552,8 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event) break; } GST_INPUT_SELECTOR_UNLOCK (sel); + if (new_tags) + g_object_notify (G_OBJECT (selpad), "tags"); if (forward) { GST_DEBUG_OBJECT (pad, "forwarding event"); res = gst_pad_push_event (sel->srcpad, event);