diff options
author | Alex Ashley <bugzilla@ashley-family.net> | 2015-11-10 16:19:34 +0000 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-12-02 10:16:25 +0200 |
commit | 0745d567a7959e01b4308c0971134d5c3d272c39 (patch) | |
tree | a136a4e2761bc985f07e03acfdf3baf6b51fb53d /tests | |
parent | ce67e8934de20d6d7b9814cb36b2a12c545339fe (diff) | |
download | gstreamer-plugins-bad-0745d567a7959e01b4308c0971134d5c3d272c39.tar.gz |
hlsdemux: correct the calculation of seek range of non-live streams
The seek range calculation for on-demand streams was incorrectly
excluding the last three segments of the stream. This three segment
rule should only be applied to live streams [1].
[1] https://tools.ietf.org/html/draft-pantos-http-live-streaming-17#section-6.3.3
https://bugzilla.gnome.org/show_bug.cgi?id=758386
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/elements/hlsdemux_m3u8.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/check/elements/hlsdemux_m3u8.c b/tests/check/elements/hlsdemux_m3u8.c index c64640cb7..6f638f9cc 100644 --- a/tests/check/elements/hlsdemux_m3u8.c +++ b/tests/check/elements/hlsdemux_m3u8.c @@ -511,6 +511,8 @@ GST_START_TEST (test_live_playlist) GstM3U8Client *client; GstM3U8 *pl; GstM3U8MediaFile *file; + gint64 start = -1; + gint64 stop = -1; client = load_playlist (LIVE_PLAYLIST); @@ -530,6 +532,9 @@ GST_START_TEST (test_live_playlist) assert_equals_string (file->uri, "https://priv.example.com/fileSequence2683.ts"); assert_equals_int (file->sequence, 2683); + fail_unless (gst_m3u8_client_get_seek_range (client, &start, &stop)); + assert_equals_int64 (start, 0); + assert_equals_float (stop / (double) GST_SECOND, 16.0); gst_m3u8_client_free (client); } @@ -573,6 +578,8 @@ GST_START_TEST (test_playlist_with_doubles_duration) GstM3U8Client *client; GstM3U8 *pl; GstM3U8MediaFile *file; + gint64 start = -1; + gint64 stop = -1; client = load_playlist (DOUBLES_PLAYLIST); @@ -586,6 +593,10 @@ GST_START_TEST (test_playlist_with_doubles_duration) assert_equals_float (file->duration / (double) GST_SECOND, 10.2344); file = GST_M3U8_MEDIA_FILE (g_list_nth_data (pl->files, 3)); assert_equals_float (file->duration / (double) GST_SECOND, 9.92); + fail_unless (gst_m3u8_client_get_seek_range (client, &start, &stop)); + assert_equals_int64 (start, 0); + assert_equals_float (stop / (double) GST_SECOND, + 10.321 + 9.6789 + 10.2344 + 9.92); gst_m3u8_client_free (client); } |