gst/gstpipeline.c: Release the object lock before trying to flush the bus.

Original commit message from CVS:
* gst/gstpipeline.c: (gst_pipeline_change_state):
Release the object lock before trying to flush the bus.
This commit is contained in:
Wim Taymans 2008-10-08 15:21:12 +00:00
parent 1fb53a23a1
commit 3245d41e16
2 changed files with 20 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2008-10-08 Wim Taymans <wim.taymans@collabora.co.uk>
* gst/gstpipeline.c: (gst_pipeline_change_state):
Release the object lock before trying to flush the bus.
2008-10-08 Wim Taymans <wim.taymans@collabora.co.uk>
* libs/gst/base/gstbasesink.c: (gst_base_sink_send_event):

View file

@ -505,17 +505,28 @@ gst_pipeline_change_state (GstElement * element, GstStateChange transition)
case GST_STATE_CHANGE_PAUSED_TO_READY:
break;
case GST_STATE_CHANGE_READY_TO_NULL:
{
GstBus *bus;
gboolean auto_flush;
/* grab some stuff before we release the lock to flush out the bus */
GST_OBJECT_LOCK (element);
if (element->bus) {
if (pipeline->priv->auto_flush_bus) {
gst_bus_set_flushing (element->bus, TRUE);
if ((bus = element->bus))
gst_object_ref (bus);
auto_flush = pipeline->priv->auto_flush_bus;
GST_OBJECT_UNLOCK (element);
if (bus) {
if (auto_flush) {
gst_bus_set_flushing (bus, TRUE);
} else {
GST_INFO_OBJECT (element, "not flushing bus, auto-flushing disabled");
}
gst_object_unref (bus);
}
GST_OBJECT_UNLOCK (element);
break;
}
}
return result;
/* ERRORS */