gst/decodebin2: Ensure we get fixed caps for topology message
authorEdward Hervey <bilboed@bilboed.com>
Tue, 20 Oct 2009 07:00:28 +0000 (09:00 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Tue, 20 Oct 2009 08:15:57 +0000 (10:15 +0200)
There are some corner cases (like with dvdemux amongst others) where
the caps won't be negotiated, but the pad has fixed caps.

gst/playback/gstdecodebin2.c

index b8ca93f..59e6910 100644 (file)
@@ -2551,6 +2551,15 @@ gst_decode_chain_get_topology (GstDecodeChain * chain)
 
   /* Caps that resulted in this chain */
   caps = gst_pad_get_negotiated_caps (chain->pad);
+  if (!caps) {
+    caps = gst_pad_get_caps (chain->pad);
+    if (G_UNLIKELY (!gst_caps_is_fixed (caps))) {
+      GST_ERROR_OBJECT (chain->pad,
+          "Couldn't get fixed caps, got %" GST_PTR_FORMAT, caps);
+      gst_caps_unref (caps);
+      caps = NULL;
+    }
+  }
   gst_structure_set (u, "caps", GST_TYPE_CAPS, caps, NULL);
   gst_caps_unref (caps);