mpdparser: Also allow '/' in RepresentationID
authorSebastian Dröge <sebastian@centricular.com>
Wed, 11 Nov 2015 15:11:14 +0000 (16:11 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 18 Nov 2015 17:17:29 +0000 (19:17 +0200)
Used by http://www.bok.net/dash/tears_of_steel/cleartext/stream.mpd

https://bugzilla.gnome.org/show_bug.cgi?id=757903

ext/dash/gstmpdparser.c
tests/check/elements/dash_mpd.c

index 29c2cf7..7b0e438 100644 (file)
@@ -3138,7 +3138,7 @@ gst_mpdparser_validate_rfc1738_url (const char *s)
 {
   while (*s) {
     if (!strchr
-        (";:@&=aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789$-_.+!*'(),%",
+        (";:@&=aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789$-_.+!*'(),%/",
             *s))
       return FALSE;
     if (*s == '%') {
@@ -3195,11 +3195,9 @@ gst_mpdparser_build_URL_from_template (const gchar * url_template,
       continue;
 
     if (!g_strcmp0 (token, "RepresentationID")) {
-      if (!gst_mpdparser_validate_rfc1738_url (id)) {
-        GST_WARNING ("String '%s' has characters invalid in an RFC 1738 URL",
-            id);
-        goto invalid_format;
-      }
+      if (!gst_mpdparser_validate_rfc1738_url (id))
+        goto invalid_representation_id;
+
       tokens[i] = g_strdup_printf ("%s", id);
       g_free (token);
     } else if (!strncmp (token, "Number", 6)) {
@@ -3260,6 +3258,16 @@ invalid_format:
 
     return NULL;
   }
+invalid_representation_id:
+  {
+    GST_ERROR
+        ("Representation ID string '%s' has characters invalid in an RFC 1738 URL",
+        id);
+
+    g_strfreev (tokens);
+
+    return NULL;
+  }
 }
 
 guint
index 1f4ae3b..76bf9d2 100644 (file)
@@ -4912,7 +4912,7 @@ GST_END_TEST;
 
 GST_START_TEST (dash_mpdparser_rfc1738_strings)
 {
-  fail_unless (gst_mpdparser_validate_rfc1738_url ("/") == FALSE);
+  fail_unless (gst_mpdparser_validate_rfc1738_url ("/") == TRUE);
   fail_unless (gst_mpdparser_validate_rfc1738_url (" ") == FALSE);
   fail_unless (gst_mpdparser_validate_rfc1738_url ("aaaaaaaa ") == FALSE);
 
@@ -4922,6 +4922,9 @@ GST_START_TEST (dash_mpdparser_rfc1738_strings)
       (";:@&=aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789$-_.+!*'(),%AA")
       == TRUE);
   fail_unless (gst_mpdparser_validate_rfc1738_url
+      (";:@&=aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789$-_.+!*'(),/%AA")
+      == TRUE);
+  fail_unless (gst_mpdparser_validate_rfc1738_url
       (";:@&=aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789$-_.+!*'(),% ")
       == FALSE);
   fail_unless (gst_mpdparser_validate_rfc1738_url ("%AA") == TRUE);