GNOME Bugzilla – Bug 776997
hlsdemux: Implement adaptivedemux's _stream_seek()
Last modified: 2017-03-02 17:26:36 UTC
_stream_seek() can be called by adaptivedemux when "restart download" condition. It's mostly caused by track switching.
Created attachment 343107 [details] [review] hlsdemux: Implement adaptivedemux's _stream_seek()
Review of attachment 343107 [details] [review]: Can you split that up into multiple patches? This looks like several changes (3?) at once, including ::: ext/hls/gsthlsdemux.c @@ +362,3 @@ + (flags & GST_SEEK_FLAG_SNAP_NEAREST) == GST_SEEK_FLAG_SNAP_NEAREST; + snap_before = ! !(flags & GST_SEEK_FLAG_SNAP_BEFORE); + snap_after = ! !(flags & GST_SEEK_FLAG_SNAP_AFTER); Refactoring the seek() function generally, mostly be moving code around a bit @@ +366,3 @@ + 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, Doing nothing if not needed here @@ +379,3 @@ + /* FIXME: check and handle return */ + gst_hls_demux_stream_seek (stream, rate > 0, flags, target_pos, + ¤t_pos); Moving part of the seek handling into the new function
Created attachment 344697 [details] [review] hlsdemux: Early terminate seeking if we don't need to do Some codes are imported from dashdemux
Created attachment 344698 [details] [review] hlsdemux: Simplify seeking code by using macro Import an adaptivedemux's macro to minimize code. Also, this patch considers KEY_UNIT and TRICKMODE_KEY_UNITS as snap seek.
Created attachment 344699 [details] [review] hlsdemux: Implement adaptivedemux's _stream_seek()
(In reply to Sebastian Dröge (slomo) from comment #2) > Review of attachment 343107 [details] [review] [review]: > > Can you split that up into multiple patches? This looks like several changes > (3?) at once, including I splinted previous patch into three part :) > ::: ext/hls/gsthlsdemux.c > @@ +362,3 @@ > + (flags & GST_SEEK_FLAG_SNAP_NEAREST) == GST_SEEK_FLAG_SNAP_NEAREST; > + snap_before = ! !(flags & GST_SEEK_FLAG_SNAP_BEFORE); > + snap_after = ! !(flags & GST_SEEK_FLAG_SNAP_AFTER); > > Refactoring the seek() function generally, mostly be moving code around a bit Please refer to attachment 344698 [details] [review] > @@ +366,3 @@ > + 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, > > Doing nothing if not needed here Please refer to attachment 344697 [details] [review]
Attachment 344697 [details] pushed as 32c4850 - hlsdemux: Early terminate seeking if we don't need to do Attachment 344698 [details] pushed as 78b2169 - hlsdemux: Simplify seeking code by using macro Attachment 344699 [details] pushed as b2e9891 - hlsdemux: Implement adaptivedemux's _stream_seek()