diff --git a/ChangeLog b/ChangeLog index 6a60d79c8f..2b67c5c776 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-10-08 Wim Taymans + + * gst/gstpipeline.c: (gst_pipeline_change_state): + Release the object lock before trying to flush the bus. + 2008-10-08 Wim Taymans * libs/gst/base/gstbasesink.c: (gst_base_sink_send_event): diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index 954957e3ae..4a916506eb 100644 --- a/gst/gstpipeline.c +++ b/gst/gstpipeline.c @@ -505,16 +505,27 @@ 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;