From 3245d41e16ea9e9aa6c5586eae3cb250e1718ea7 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 8 Oct 2008 15:21:12 +0000 Subject: [PATCH] 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. --- ChangeLog | 5 +++++ gst/gstpipeline.c | 19 +++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6a60d79..2b67c5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 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): Forward LATENCY events upstreams so that elements know about the total pipeline latency. Fixes #555307. diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index 954957e..4a91650 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; -- 2.7.4