From 6c014f7e365df5d6ac886154fe76da310533ef2f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 3 Apr 2014 11:48:07 +0200 Subject: [PATCH] mpdparse: only add location when node existed Actually return FALSE when the location node was non-existing Only add the location node when it existed --- ext/dash/gstmpdparser.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index 3ea6e892e4..ab60adf6da 100644 --- a/ext/dash/gstmpdparser.c +++ b/ext/dash/gstmpdparser.c @@ -937,7 +937,7 @@ static gboolean gst_mpdparser_get_xml_node_content (xmlNode * a_node, gchar ** content) { xmlChar *node_content = NULL; - gboolean exists = TRUE; + gboolean exists = FALSE; node_content = xmlNodeGetContent (a_node); if (node_content) { @@ -1061,12 +1061,11 @@ gst_mpdparser_parse_content_component_node (GList ** list, xmlNode * a_node) static void gst_mpdparser_parse_location_node (GList ** list, xmlNode * a_node) { - gchar *location; + gchar *location = NULL; GST_LOG ("content of Location node:"); - gst_mpdparser_get_xml_node_content (a_node, &location); - - *list = g_list_append (*list, location); + if (gst_mpdparser_get_xml_node_content (a_node, &location)) + *list = g_list_append (*list, location); } static void