gst/decodebin2: Don't expose chains if we're shutting down.
authorEdward Hervey <bilboed@bilboed.com>
Tue, 20 Oct 2009 06:52:36 +0000 (08:52 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Tue, 20 Oct 2009 08:15:48 +0000 (10:15 +0200)
This avoids adding flushing pads to ourself

gst/playback/gstdecodebin2.c

index 81e787f..b8ca93f 100644 (file)
@@ -2579,6 +2579,15 @@ gst_decode_bin_expose (GstDecodeBin * dbin)
 
   GST_DEBUG_OBJECT (dbin, "Exposing currently active chains/groups");
 
+  /* Don't expose if we're currently shutting down */
+  DYN_LOCK (dbin);
+  if (G_UNLIKELY (dbin->shutdown == TRUE)) {
+    GST_WARNING_OBJECT (dbin, "Currently, shutting down, aborting exposing");
+    DYN_UNLOCK (dbin);
+    return FALSE;
+  }
+  DYN_UNLOCK (dbin);
+
   /* Get the pads that we're going to expose and mark things as exposed */
   if (!gst_decode_chain_expose (dbin->decode_chain, &endpads)) {
     g_list_foreach (endpads, (GFunc) gst_object_unref, NULL);