Commit e2d11263 authored by Florin Apostol's avatar Florin Apostol Committed by Thiago Santos
Browse files

dashdemux: corrected recognition of $$$ in segment templates

fixed recognition of $$ after a $ that ends an identifier, eg $Time$$$

https://bugzilla.gnome.org/show_bug.cgi?id=751682
parent d5a676ae
......@@ -2681,6 +2681,8 @@ gst_mpdparser_build_URL_from_template (const gchar * url_template,
tokens[i] = g_strdup_printf ("%s", "$");
g_free (token);
last_token_par = TRUE;
} else {
last_token_par = FALSE;
}
} else {
last_token_par = FALSE;
......
......@@ -2125,6 +2125,30 @@ GST_START_TEST (dash_mpdparser_type_dynamic)
GST_END_TEST;
/*
* Validate gst_mpdparser_build_URL_from_template function
*
*/
GST_START_TEST (dash_mpdparser_template_parsing)
{
const gchar *url_template;
const gchar *id = "TestId";
guint number = 7;
guint bandwidth = 2500;
guint64 time = 100;
gchar *result;
url_template = "TestMedia$Bandwidth$$$test";
result =
gst_mpdparser_build_URL_from_template (url_template, id, number,
bandwidth, time);
assert_equals_string (result, "TestMedia2500$test");
g_free (result);
}
GST_END_TEST;
/*
* Test handling Representation selection
*
......@@ -2468,6 +2492,7 @@ dash_suite (void)
/* tests checking other possible values for attributes */
tcase_add_test (tc_simpleMPD, dash_mpdparser_type_dynamic);
tcase_add_test (tc_simpleMPD, dash_mpdparser_template_parsing);
tcase_add_test (tc_complexMPD, dash_mpdparser_representation_selection);
/* tests checking the parsing of missing/incomplete attributes of xml */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment