decodebin: Only link elements further after setting them to PAUSED
authorSebastian Dröge <sebastian@centricular.com>
Thu, 10 Jul 2014 10:50:17 +0000 (12:50 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 21 Jul 2014 07:35:36 +0000 (09:35 +0200)
They might fail to go to PAUSED, and when connecting them further
we might already expose their srcpads on decodebin if we're unlucky.
This prevents us to handle failures going to PAUSED gracefully.

gst/playback/gstdecodebin2.c

index 788b481..882ef54 100644 (file)
@@ -2203,9 +2203,6 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
       }
     }
 
-    /* link this element further */
-    connect_element (dbin, delem, chain);
-
     /* try to configure the subtitle encoding property when we can */
     pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (element),
         "subtitle-encoding");
@@ -2302,6 +2299,9 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
       SUBTITLE_UNLOCK (dbin);
     }
 
+    /* link this element further */
+    connect_element (dbin, delem, chain);
+
     res = TRUE;
     break;
   }