GNOME Bugzilla – Bug 759108
hlsdemux: add support for snapping seek flags
Last modified: 2015-12-08 22:44:35 UTC
Seeking to a position which not near a segment boundary can result in the seek taking quite a while to complete. There are a couple of scenarios; - The bitrate of the connection not much more than the bitrate of the variant; in this case, we have to wait for the data between segment start and seek position to download before our initial frame can be decoded. This can take a couple of seconds. - The stream is high bitrate and/or encrypted, and we're running on a slow embedded processor. So, even tho data before the start position is not decoded, it still takes significant time to process it. Again, this can increase the time taken to seek by the order of seconds. This problem can be avoided by using the seek snap flags to seek to a segment boundary only.
Created attachment 316862 [details] [review] Honour seek snap flags
Created attachment 316863 [details] [review] Honor seek snap flags Correct the comment.
Review of attachment 316863 [details] [review]: Looks almost good, thanks for the patch ::: ext/hls/gsthlsdemux.c @@ +350,3 @@ + gboolean update; + gst_segment_do_seek (&demux->segment, rate, format, flags, start_type, + current_pos, stop_type, stop, &update); You could just pass NULL for update
Created attachment 316912 [details] [review] Honour seek snap flags I should have looked further than the comment block on gst_segment_do_seek(); updated patch attached.
commit 612f16936cf1523860aa86c188d30f478034e625 Author: Duncan Palmer <dpalmer@digisoft.tv> Date: Mon Dec 7 14:10:30 2015 +1000 hlsdemux: add support for seeking to fragment boundaries Setting the seek flags to GST_SEEK_FLAG_SNAP_* will change the seek target time to a segment boundary. Based on original work by Ben Willers <bwillers@digisoft.tv>. https://bugzilla.gnome.org/show_bug.cgi?id=759108
Now we should ideally do exactly the same for dashdemux and mssdemux :)
Yes, that occurred to me as well. I see you've raised another issue on it. I'd like to spend a bit of time with dash demux at least. But it could be a couple of months before that time materialises...