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
This commit is contained in:
Florin Apostol 2015-06-29 22:18:38 +01:00 committed by Thiago Santos
parent d5a676aec8
commit e2d1126391
2 changed files with 27 additions and 0 deletions

View file

@ -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;

View file

@ -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 */