From 60d5d08fbb98e5e6e8ae73e2e5b87a8ea8f1b51e Mon Sep 17 00:00:00 2001
From: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date: Mon, 3 Oct 2011 14:51:56 +0200
Subject: [PATCH] decodebin2: tweak chain topology description

... to also properly indicate chain's endpad if no elements are in the
chain (due to the endpad being a raw demuxer pad, or one setup without
decoders since uridecodebin or higher up decided not to need those).
---
 gst/playback/gstdecodebin2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c
index c7e8921d05..8bcadde028 100644
--- a/gst/playback/gstdecodebin2.c
+++ b/gst/playback/gstdecodebin2.c
@@ -3443,7 +3443,8 @@ gst_decode_chain_get_topology (GstDecodeChain * chain)
   u = gst_structure_id_empty_new (topology_structure_name);
 
   /* Now at the last element */
-  if (chain->elements && (chain->endpad || chain->deadend)) {
+  if ((chain->elements || !chain->active_group) &&
+      (chain->endpad || chain->deadend)) {
     s = gst_structure_id_empty_new (topology_structure_name);
     gst_structure_id_set (u, topology_caps, GST_TYPE_CAPS, chain->endcaps,
         NULL);