From 891c54f6f81be3b4fd4c341fa7760615f0527ed6 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 20 Oct 2009 09:00:28 +0200 Subject: [PATCH] gst/decodebin2: Ensure we get fixed caps for topology message 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index b8ca93fcd7..59e6910171 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -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); -- 2.34.1