hlsdemux: Consider timestamp of the first fragment in playlist when live seeking
authorSeungha Yang <sh.yang@lge.com>
Tue, 24 Jan 2017 11:21:19 +0000 (20:21 +0900)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 31 Jan 2017 11:23:34 +0000 (13:23 +0200)
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

index 3e82d58e986399c66030698bea5b6f95d7855e42..44be04e5086598fc563b6dc1cd88c179c68d1a85 100644 (file)
@@ -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;