From: Sebastian Dröge Date: Thu, 10 Dec 2015 09:35:05 +0000 (+0200) Subject: element: Don't hold state lock all the time while sending an event X-Git-Tag: 1.10.4~580 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b427997119a2b6aacbeb550f729936f8b963e24b;p=platform%2Fupstream%2Fgstreamer.git element: Don't hold state lock all the time while sending an event This lock seems to exist only to prevent elements from changing states while events are being processed. However events are going to be processed nonetheless in those elements if sent directly via pads, so protection must already be implemented inside the elements for event handling if it is needed. As such having the lock here is not very useful and is actually causing various deadlocks in different situations as described in https://bugzilla.gnome.org/show_bug.cgi?id=744040 --- diff --git a/gst/gstelement.c b/gst/gstelement.c index 3828277..832ac27 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -1566,13 +1566,11 @@ gst_element_send_event (GstElement * element, GstEvent * event) oclass = GST_ELEMENT_GET_CLASS (element); - GST_STATE_LOCK (element); if (oclass->send_event) { GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, "send %s event on element %s", GST_EVENT_TYPE_NAME (event), GST_ELEMENT_NAME (element)); result = oclass->send_event (element, event); } - GST_STATE_UNLOCK (element); return result; }