From 6b3e3544d41ce0bc42c3597b3eb2130719379917 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 5 Jan 2012 08:29:43 +0100 Subject: [PATCH] decodebin2: Try harder to get initial topology caps Since caps are no longer 'shared' between two pads (but forwarded from source pad to sink pad) we end up with the first chain pad not having specified caps (i.e. typefind:src). This solves the issues by getting the pad's peer caps. It is not optimal since it will (for most demuxers) return the pad template caps, which might contain non-fixed caps (ex : with qtdemux "video/quicktime; video/mj2; audio/x-m4a; application/x-3gp") https://bugzilla.gnome.org/show_bug.cgi?id=667337 --- gst/playback/gstdecodebin2.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index d266d7190b..e3501abc57 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -3512,6 +3512,14 @@ gst_decode_chain_get_topology (GstDecodeChain * chain) /* Caps that resulted in this chain */ caps = gst_pad_get_current_caps (chain->pad); + + if (!caps) { + /* Try querying the peer sink pad caps. + * This will most likely be the case with typefind:src + */ + caps = gst_pad_peer_query_caps (chain->pad, NULL); + } + if (!caps) { caps = get_pad_caps (chain->pad); if (G_UNLIKELY (!gst_caps_is_fixed (caps))) {