summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2015-12-28 02:18:06 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2016-01-06 10:23:13 -0300
commitb8e0c365c411465c76bde7ea0be648fbe3fb4c19 (patch)
tree64669b8d31a53530588885241f5c4d8ebe6ca381 /ext
parentbe753b49517303b34913ad225f2aec7cd6e4d934 (diff)
downloadgstreamer-plugins-bad-b8e0c365c411465c76bde7ea0be648fbe3fb4c19.tar.gz
hlsdemux: respect keyunit flag for position
Set the segment start position when keyunit flag is active
Diffstat (limited to 'ext')
-rw-r--r--ext/hls/gsthlsdemux.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c
index 6c5468dee..184f2ef6e 100644
--- a/ext/hls/gsthlsdemux.c
+++ b/ext/hls/gsthlsdemux.c
@@ -247,7 +247,7 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
gint64 current_sequence;
GstM3U8MediaFile *file;
guint64 bitrate;
- gboolean snap_before, snap_after, snap_nearest;
+ gboolean snap_before, snap_after, snap_nearest, keyunit;
gst_event_parse_seek (seek, &rate, &format, &flags, &start_type, &start,
&stop_type, &stop);
@@ -308,6 +308,7 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
/* Snap to segment boundary. Improves seek performance on slow machines. */
snap_before = snap_after = snap_nearest = FALSE;
+ keyunit = flags & GST_SEEK_FLAG_KEY_UNIT;
if ((flags & GST_SEEK_FLAG_SNAP_NEAREST) == GST_SEEK_FLAG_SNAP_NEAREST)
snap_nearest = TRUE;
else if (flags & GST_SEEK_FLAG_SNAP_BEFORE)
@@ -346,7 +347,7 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
hlsdemux->client->sequence_position = current_pos;
GST_M3U8_CLIENT_UNLOCK (hlsdemux->client);
- if (snap_before || snap_after || snap_nearest)
+ if (keyunit || snap_before || snap_after || snap_nearest)
gst_segment_do_seek (&demux->segment, rate, format, flags, start_type,
current_pos, stop_type, stop, NULL);