basesink: don't unlock mutex that is not locked
authorTim-Philipp Müller <tim@centricular.com>
Fri, 24 Oct 2014 11:51:07 +0000 (12:51 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 24 Oct 2014 11:51:07 +0000 (12:51 +0100)
Fixes 'Attempt to unlock mutex that was not locked'
warning with newer GLibs when sink is shut down in
certain situations. Triggered by the decodebin
test_reuse_without_decoders unit test in -base
sometimes, esp. on slower machines.

libs/gst/base/gstbasesink.c

index 10f5bdf..aa24f98 100644 (file)
@@ -1507,7 +1507,7 @@ gst_base_sink_commit_state (GstBaseSink * basesink)
       /* state change function could have been executed and we could be
        * flushing now */
       if (G_UNLIKELY (basesink->flushing))
-        goto stopping;
+        goto stopping_unlocked;
     }
     GST_DEBUG_OBJECT (basesink, "posting PLAYING state change message");
     /* FIXME, we released the PREROLL lock above, it's possible that this
@@ -1547,6 +1547,11 @@ nothing_pending:
     GST_OBJECT_UNLOCK (basesink);
     return TRUE;
   }
+stopping_unlocked:
+  {
+    GST_OBJECT_LOCK (basesink);
+    goto stopping;
+  }
 stopping:
   {
     /* app is going to READY */