diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index 08fa1d1c9f..eefa02595e 100644 --- a/ext/dash/gstmpdparser.c +++ b/ext/dash/gstmpdparser.c @@ -2431,7 +2431,6 @@ static gchar * gst_mpdparser_parse_baseURL (GstMpdClient * client, GstActiveStream * stream, gchar ** query) { - //GstActiveStream *stream; GstStreamPeriod *stream_period; GstBaseURL *baseURL; GList *list; @@ -2439,9 +2438,6 @@ gst_mpdparser_parse_baseURL (GstMpdClient * client, GstActiveStream * stream, static gchar empty[] = ""; gchar *ret = NULL; - //stream = - // gst_mpdparser_get_active_stream_by_index (client, client->stream_idx); - g_return_val_if_fail (stream != NULL, empty); stream_period = gst_mpdparser_get_stream_period (client); g_return_val_if_fail (stream_period != NULL, empty); @@ -2486,6 +2482,7 @@ gst_mpdparser_parse_baseURL (GstMpdClient * client, GstActiveStream * stream, } ret = g_strjoinv (NULL, baseURL_array); + /* get base URI from MPD file URI, if the "http" scheme is missing */ if (client->mpd_uri != NULL && strncmp (ret, "http://", 7) != 0) { gchar *last_sep, *tmp1, *tmp2; @@ -2515,6 +2512,14 @@ gst_mpdparser_parse_baseURL (GstMpdClient * client, GstActiveStream * stream, } } + if (ret && *query == NULL) { + gchar *params = strchr (ret, '?'); + if (params) { + *query = g_strdup (params); + params[0] = '\0'; /* can ignore the rest of the string */ + } + } + return ret; }