hlsdemux: Handle GST_SEEK_TYPE_NONE seek
When one is only updating the "stop" position (i.e. non-flushing seek, with GST_SEEK_TYPE_NONE on the "start" (or stop in reverse) position), we only need to store those values instead of moving the current position. https://bugzilla.gnome.org/show_bug.cgi?id=775127
This commit is contained in:
parent
9b89f58cae
commit
9053a01e72
@ -296,7 +296,7 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
|
|||||||
GstHLSDemux *hlsdemux = GST_HLS_DEMUX_CAST (demux);
|
GstHLSDemux *hlsdemux = GST_HLS_DEMUX_CAST (demux);
|
||||||
GstFormat format;
|
GstFormat format;
|
||||||
GstSeekFlags flags;
|
GstSeekFlags flags;
|
||||||
GstSeekType start_type, stop_type;
|
GstSeekType start_type, stop_type, target_type;
|
||||||
gint64 start, stop;
|
gint64 start, stop;
|
||||||
gdouble rate, old_rate;
|
gdouble rate, old_rate;
|
||||||
GList *walk, *stream_walk;
|
GList *walk, *stream_walk;
|
||||||
@ -348,6 +348,7 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
|
|||||||
/* TODO why not continue using the same? that was being used up to now? */
|
/* TODO why not continue using the same? that was being used up to now? */
|
||||||
gst_hls_demux_change_playlist (hlsdemux, bitrate, NULL);
|
gst_hls_demux_change_playlist (hlsdemux, bitrate, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (stream_walk = demux->streams; stream_walk != NULL;
|
for (stream_walk = demux->streams; stream_walk != NULL;
|
||||||
stream_walk = stream_walk->next) {
|
stream_walk = stream_walk->next) {
|
||||||
GstHLSDemuxStream *hls_stream =
|
GstHLSDemuxStream *hls_stream =
|
||||||
@ -358,7 +359,13 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
|
|||||||
current_pos = 0;
|
current_pos = 0;
|
||||||
reverse = rate < 0;
|
reverse = rate < 0;
|
||||||
target_pos = reverse ? stop : start;
|
target_pos = reverse ? stop : start;
|
||||||
|
target_type = reverse ? stop_type : start_type;
|
||||||
|
|
||||||
|
if (target_type == GST_SEEK_TYPE_NONE && !(flags & GST_SEEK_FLAG_FLUSH)) {
|
||||||
|
/* No need to move */
|
||||||
|
gst_segment_do_seek (&demux->segment, rate, format, flags, start_type,
|
||||||
|
start, stop_type, stop, NULL);
|
||||||
|
} else {
|
||||||
/* Snap to segment boundary. Improves seek performance on slow machines. */
|
/* Snap to segment boundary. Improves seek performance on slow machines. */
|
||||||
keyunit = ! !(flags & GST_SEEK_FLAG_KEY_UNIT);
|
keyunit = ! !(flags & GST_SEEK_FLAG_KEY_UNIT);
|
||||||
snap_nearest =
|
snap_nearest =
|
||||||
@ -420,6 +427,7 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
|
|||||||
start, stop_type, current_pos, NULL);
|
start, stop_type, current_pos, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user