gst/gstpipeline.c: Release the object lock before trying to flush the bus.
authorWim Taymans <wim.taymans@gmail.com>
Wed, 8 Oct 2008 15:21:12 +0000 (15:21 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Wed, 8 Oct 2008 15:21:12 +0000 (15:21 +0000)
Original commit message from CVS:
* gst/gstpipeline.c: (gst_pipeline_change_state):
Release the object lock before trying to flush the bus.

ChangeLog
gst/gstpipeline.c

index 6a60d79..2b67c5c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 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):
        Forward LATENCY events upstreams so that elements know about the total
        pipeline latency. Fixes #555307.
index 954957e..4a91650 100644 (file)
@@ -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;