summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ashley <bugzilla@ashley-family.net>2015-11-10 16:25:53 +0000
committerThiago Santos <thiagoss@osg.samsung.com>2015-12-22 11:15:32 -0300
commitebf6de33d2744fd68f6273e6f66dce94b8c3f552 (patch)
treeac4bab9bd2606e52688db0cb6995ccc7fa5dfaf6
parentf6bff8f5f5ca14cae5774d79e7b7c4ac0542a67f (diff)
downloadgstreamer-plugins-bad-ebf6de33d2744fd68f6273e6f66dce94b8c3f552.tar.gz
hlsdemux: tests: check URL joining if media URL contains a '/' character
If the query parameter (for example http://example.net/1054559_1500k.mp4/master.m3u8?acl=/*1054559_1500k.mp4), check that m3u8.c correctly converts the relative URLs of the media playlists in to absolute URLs. It must not use the last '/' it finds in the URL, as according to RFC3986 the '/' character is allowed in the query part of the URL. https://bugzilla.gnome.org/show_bug.cgi?id=758384
-rw-r--r--tests/check/elements/hlsdemux_m3u8.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/check/elements/hlsdemux_m3u8.c b/tests/check/elements/hlsdemux_m3u8.c
index d655044ef..f49e90184 100644
--- a/tests/check/elements/hlsdemux_m3u8.c
+++ b/tests/check/elements/hlsdemux_m3u8.c
@@ -1333,6 +1333,26 @@ GST_START_TEST (test_simulation)
GST_END_TEST;
#endif
+GST_START_TEST (test_url_with_slash_query_param)
+{
+ 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"
+ "1251/media.m3u8?acl=/*1054559_h264_1500k.mp4\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_string (media->uri,
+ "http://localhost/1251/media.m3u8?acl=/*1054559_h264_1500k.mp4");
+ gst_m3u8_client_free (client);
+}
+
+GST_END_TEST;
+
GST_START_TEST (test_stream_inf_tag)
{
static const gchar *MASTER_PLAYLIST = "#EXTM3U \n"
@@ -1396,6 +1416,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_url_with_slash_query_param);
tcase_add_test (tc_m3u8, test_stream_inf_tag);
return s;
}