From a0b3a7f65878a844b1f983441749afdd3512ee54 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 17 Feb 2016 16:41:02 +0200 Subject: [PATCH] Revert "element: Don't hold state lock all the time while sending an event" This reverts commit b427997119a2b6aacbeb550f729936f8b963e24b. It breaks things that used to work before, even if the change by itself is correct and the previous code is just working around deeper bugs in the async state change code. Let's go back to what previously worked and then fix async state changes in general. https://bugzilla.gnome.org/show_bug.cgi?id=760532 --- gst/gstelement.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gst/gstelement.c b/gst/gstelement.c index 6a17d74..6bc013d 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -1566,6 +1566,7 @@ 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)); @@ -1573,6 +1574,7 @@ gst_element_send_event (GstElement * element, GstEvent * event) } else { gst_event_unref (event); } + GST_STATE_UNLOCK (element); return result; } -- 2.7.4