From e9e6e4a4f64379a28247954277ab311d5b96045e Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 24 Jan 2017 20:21:19 +0900 Subject: [PATCH] hlsdemux: Consider timestamp of the first fragment in playlist when live seeking During live playback, the first fragment in a updated playlist can be advanced from that of startup playlist. Meanwhile, since hlsdemux finds target seek position by just accumulating fragment's duration, the base should be adjusted to the updated first fragment's timestamp. https://bugzilla.gnome.org/show_bug.cgi?id=777682 --- ext/hls/gsthlsdemux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c index 3e82d58e98..44be04e508 100644 --- a/ext/hls/gsthlsdemux.c +++ b/ext/hls/gsthlsdemux.c @@ -356,7 +356,8 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek) GstM3U8MediaFile *file = NULL; current_sequence = 0; - current_pos = 0; + current_pos = gst_m3u8_is_live (hls_stream->playlist) ? + hls_stream->playlist->first_file_start : 0; reverse = rate < 0; target_pos = reverse ? stop : start; target_type = reverse ? stop_type : start_type;