diff options
author | Alex Ashley <bugzilla@ashley-family.net> | 2015-11-10 16:23:59 +0000 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2015-12-22 11:15:32 -0300 |
commit | f6bff8f5f5ca14cae5774d79e7b7c4ac0542a67f (patch) | |
tree | 258ed4db361fc37f30bcae3f869973040de3f00f /tests | |
parent | eafdf5673a38537fc41cfdc08c29321810387a39 (diff) | |
download | gstreamer-plugins-bad-f6bff8f5f5ca14cae5774d79e7b7c4ac0542a67f.tar.gz |
hlsdemux: unquote all the quoted-string attributes
The URI attribute from the EXT-X-KEY tag and the URI attribute from the
EXT-X-I-FRAMES-ONLY tag are both quoted-string attibutes that have their
quotation marks removed during parsing. The CODECS attribute of the
EXT-X-STREAM-INF is also a quoted-string attribute, but this attribute
was not being un-quoted.
This commit changes the parser to always unquote all quoted-string
attributes and adjusts the unit tests to this new bevahiour for the
CODECS attribute.
An additional test is added to check that parsing of all of the fields
in the EXT-X-STREAM tag is correct, including those that contain comma
characters.
https://bugzilla.gnome.org/show_bug.cgi?id=758384
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/elements/hlsdemux_m3u8.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/tests/check/elements/hlsdemux_m3u8.c b/tests/check/elements/hlsdemux_m3u8.c index 6f638f9cc..d655044ef 100644 --- a/tests/check/elements/hlsdemux_m3u8.c +++ b/tests/check/elements/hlsdemux_m3u8.c @@ -381,7 +381,7 @@ do_test_load_main_playlist_variant (const gchar * playlist) assert_equals_int (stream->bandwidth, 65000); assert_equals_int (stream->program_id, 1); assert_equals_string (stream->uri, "http://example.com/audio-only.m3u8"); - assert_equals_string (stream->codecs, "\"mp4a.40.5\""); + assert_equals_string (stream->codecs, "mp4a.40.5"); /* Low */ tmp = g_list_next (tmp); @@ -1333,6 +1333,29 @@ GST_START_TEST (test_simulation) GST_END_TEST; #endif +GST_START_TEST (test_stream_inf_tag) +{ + static const gchar *MASTER_PLAYLIST = "#EXTM3U \n" + "#EXT-X-VERSION:4\n" + "#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1251135, CODECS=\"avc1.42001f, mp4a.40.2\", RESOLUTION=640x352\n" + "media.m3u8\n"; + GstM3U8Client *client; + GstM3U8 *media; + + client = load_playlist (MASTER_PLAYLIST); + + assert_equals_int (g_list_length (client->main->lists), 1); + media = g_list_nth_data (client->main->lists, 0); + assert_equals_int64 (media->program_id, 1); + assert_equals_int64 (media->width, 640); + assert_equals_int64 (media->height, 352); + assert_equals_int64 (media->bandwidth, 1251135); + assert_equals_string (media->codecs, "avc1.42001f, mp4a.40.2"); + gst_m3u8_client_free (client); +} + +GST_END_TEST; + static Suite * hlsdemux_suite (void) { @@ -1373,7 +1396,7 @@ hlsdemux_suite (void) #endif tcase_add_test (tc_m3u8, test_playlist_with_doubles_duration); tcase_add_test (tc_m3u8, test_playlist_with_encryption); - + tcase_add_test (tc_m3u8, test_stream_inf_tag); return s; } |