From a5752d8ea733d792c650d33063e733831ce34277 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 24 Sep 2010 16:02:42 +0200 Subject: [PATCH] decodebin2: Don't add non prerolled stream to topology If a final stream didn't preroll, don't add it to the topology since it doesn't give any information at all. https://bugzilla.gnome.org/show_bug.cgi?id=632988 --- gst/playback/gstdecodebin2.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index f8c459f..3efeb31 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -3000,6 +3000,12 @@ gst_decode_chain_get_topology (GstDecodeChain * chain) GList *l; GstCaps *caps; + if (G_UNLIKELY ((chain->endpad || chain->deadend) + && (chain->endcaps == NULL))) { + GST_WARNING ("End chain without valid caps !"); + return NULL; + } + u = gst_structure_id_empty_new (topology_structure_name); /* Now at the last element */ @@ -3021,10 +3027,12 @@ gst_decode_chain_get_topology (GstDecodeChain * chain) g_value_init (&item, GST_TYPE_STRUCTURE); for (l = chain->active_group->children; l; l = l->next) { s = gst_decode_chain_get_topology (l->data); - gst_value_set_structure (&item, s); - gst_value_list_append_value (&list, &item); - g_value_reset (&item); - gst_structure_free (s); + if (s) { + gst_value_set_structure (&item, s); + gst_value_list_append_value (&list, &item); + g_value_reset (&item); + gst_structure_free (s); + } } gst_structure_id_set_value (u, topology_next, &list); g_value_unset (&list); -- 2.7.4