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
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));
} else {
gst_event_unref (event);
}
+ GST_STATE_UNLOCK (element);
return result;
}