After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776997 - hlsdemux: Implement adaptivedemux's _stream_seek()
hlsdemux: Implement adaptivedemux's _stream_seek()
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.11.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-08 04:49 UTC by Seungha Yang
Modified: 2017-03-02 17:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
hlsdemux: Implement adaptivedemux's _stream_seek() (8.93 KB, patch)
2017-01-08 04:49 UTC, Seungha Yang
none Details | Review
hlsdemux: Early terminate seeking if we don't need to do (6.95 KB, patch)
2017-02-01 11:32 UTC, Seungha Yang
committed Details | Review
hlsdemux: Simplify seeking code by using macro (2.59 KB, patch)
2017-02-01 11:33 UTC, Seungha Yang
committed Details | Review
hlsdemux: Implement adaptivedemux's _stream_seek() (8.64 KB, patch)
2017-02-01 11:33 UTC, Seungha Yang
committed Details | Review

Description Seungha Yang 2017-01-08 04:49:30 UTC
_stream_seek() can be called by adaptivedemux when "restart download" condition.
It's mostly caused by track switching.
Comment 1 Seungha Yang 2017-01-08 04:49:59 UTC
Created attachment 343107 [details] [review]
hlsdemux: Implement adaptivedemux's _stream_seek()
Comment 2 Sebastian Dröge (slomo) 2017-01-31 11:29:23 UTC
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,
+        &current_pos);

Moving part of the seek handling into the new function
Comment 3 Seungha Yang 2017-02-01 11:32:42 UTC
Created attachment 344697 [details] [review]
hlsdemux: Early terminate seeking if we don't need to do

Some codes are imported from dashdemux
Comment 4 Seungha Yang 2017-02-01 11:33:20 UTC
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.
Comment 5 Seungha Yang 2017-02-01 11:33:37 UTC
Created attachment 344699 [details] [review]
hlsdemux: Implement adaptivedemux's _stream_seek()
Comment 6 Seungha Yang 2017-02-01 11:36:11 UTC
(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]
Comment 7 Sebastian Dröge (slomo) 2017-03-02 17:26:16 UTC
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()