mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 00:06:36 +00:00
mpdparser: Also allow '/' in RepresentationID
Used by http://www.bok.net/dash/tears_of_steel/cleartext/stream.mpd https://bugzilla.gnome.org/show_bug.cgi?id=757903
This commit is contained in:
parent
3eeec2836a
commit
87b5ad0dfc
2 changed files with 18 additions and 7 deletions
|
@ -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)) {
|
||||
|
@ -3258,6 +3256,16 @@ invalid_format:
|
|||
|
||||
g_strfreev (tokens);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
@ -4921,6 +4921,9 @@ GST_START_TEST (dash_mpdparser_rfc1738_strings)
|
|||
fail_unless (gst_mpdparser_validate_rfc1738_url
|
||||
(";:@&=aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789$-_.+!*'(),%AA")
|
||||
== TRUE);
|
||||
fail_unless (gst_mpdparser_validate_rfc1738_url
|
||||
(";:@&=aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789$-_.+!*'(),/%AA")
|
||||
== TRUE);
|
||||
fail_unless (gst_mpdparser_validate_rfc1738_url
|
||||
(";:@&=aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789$-_.+!*'(),% ")
|
||||
== FALSE);
|
||||
|
|
Loading…
Reference in a new issue