dashdemux: mpd parsing: fix query parameter parsing
authorThiago Santos <thiago.sousa.santos@collabora.com>
Tue, 19 Feb 2013 04:26:25 +0000 (01:26 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Wed, 8 May 2013 21:14:41 +0000 (18:14 -0300)
Try harder to detect URL parameters and split them to accomodate
the fragment url in the concat:

base-url + fragment-url + url-parameters

ext/dash/gstmpdparser.c

index 08fa1d1..eefa025 100644 (file)
@@ -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;
 }