GNOME Bugzilla – Bug 778763
adaptivedemux: Handle seek during preroll
Last modified: 2018-05-08 07:30:58 UTC
Add probe to fix deadlock and bug on seeking. * About deadlock Assume that seek event was forwarded from a srcpad, and demux is handling it now. At the same time, any queries/event which take manifest lock might be forwarded from the other pads. Since _handle_seek_event() takes manifest lock, the queries/event can never be handled until _handle_seek_event() is finished. Also, demux cannot push flush event since the pads are stream locked by the queries/event. * Delay handle seek until preroll done Because subclass handles seeking only for existing stream (not preparing stream), wait on preroll.
Created attachment 345944 [details] [review] adaptivedemux: Add pad probe for upstream event/query
Created attachment 345945 [details] [review] adaptivedemux: Print preroll lock/unlock log
Created attachment 345946 [details] [review] adaptivedemux: Stop prepare stream's task if needed When demux chagnes state from PAUSED to READY, there can be prepared but not yet exposed streams. To unload pipeline, the tasks of those streams and corresponding source elements should be stopped.
*** Bug 776606 has been marked as a duplicate of this bug. ***
Created attachment 346297 [details] [review] adaptivedemux: Release manifest lock before pushing flush event
Created attachment 346298 [details] [review] adaptivedemux: Reset "cancelled" to FALSE whatever target stream is No reason to restrict only non prepared stream.
Created attachment 346299 [details] [review] adaptivedemux: Handle seek event during prerolling
Created attachment 346300 [details] [review] hlsdemux: Select target seeking stream depending on demux's preroll state Although demux is doing preroll (not yet finished), demux can get seek event. In this case, demux needs to do seek only for prepared streams, since existing streams will be removed after preroll done.
Created attachment 346302 [details] [review] adaptivedemux: Move preroll count to _start_tasks () function To reset preroll pending count whenever start new tasks
Comment on attachment 346297 [details] [review] adaptivedemux: Release manifest lock before pushing flush event Fixed in bug #781320
Seungha, is the issue still present with that commit from #781320 ?
(In reply to Edward Hervey from comment #11) > Seungha, is the issue still present with that commit from #781320 ? I guess issue still be there but I'll test again on top of master and let you know :) Note that it was hard to reproduce since seek and preroll should be happen at the same time.
(In reply to Edward Hervey from comment #11) > Seungha, is the issue still present with that commit from #781320 ? Hello Edward The issue is still there... I'll do re-work the previously reported patch and update unit test code for prerolling soon.
Created attachment 350261 [details] [review] adaptivedemux: Move preroll count to _start_tasks () function To reset preroll pending count whenever start new tasks
Created attachment 350262 [details] [review] adaptivedemux: Stop tasks of preroll streams with gst_adaptive_demux_stop_tasks When demux changes state from PAUSED to READY or does seek, there can be prepared but not yet exposed streams.
Created attachment 350263 [details] [review] adaptivedemux: Clear pending preroll streams during seek Start preroll again if any pending preroll streams are there during seek
Created attachment 350264 [details] [review] dashdemux: Setup streams again if there are pending preroll streams Handle the case that period change and seek happen at the same time
Created attachment 350265 [details] [review] [DO NOT MERGE] test for adaptivedemux seek during preroll - Disable waiting async/buffering to do next action - Add scenario of seek back/forward for specific multi-period DASH stream
The issue can be reproduced by GST_VALIDATE_SCENARIO='seek_over_period' DISPLAY=':0' GST_VALIDATE_OVERRIDE='.../medias/dash-if/DASHIF_TestCases_5c_nomor_4_1a.override' GST_GL_XINITTHREADS='1' .../gst-validate-1.0 playbin uri=http://dash.akamaized.net/dash264/TestCases/5c/nomor/4_1a.mpd audio-sink=fakesink sync=true video-sink=fakesink sync=true qos=true max-lateness=20000000 --set-media-info .../gst-validate/gst-integration-testsuites/medias/dash-if/DASHIF_TestCases_5c_nomor_4_1a.stream_info
need revisit after fix of bug #773159 Both reports seems to be closely related
Comment on attachment 350262 [details] [review] adaptivedemux: Stop tasks of preroll streams with gst_adaptive_demux_stop_tasks Duplication of bug #785987
Note that handling seek during preroll (also called "seek-in-ready") is a generic problem that should be solved in another way, I have a plan for that.
There is another bug about seeking in ready: https://bugzilla.gnome.org/show_bug.cgi?id=696952
I explained the logic in that bug. Marking as duplicate. *** This bug has been marked as a duplicate of bug 696952 ***