Flush MSE rendering pipeline when crossing video buffer holes with audio #6972
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will...
Flush MSE rendering pipeline when crossing video buffer holes with audio.
Why is this Pull Request needed?
Chrome will play past a hole in the video buffer when there is audio, but video will not render and playback will stall one second past the hole. https://issues.chromium.org/issues/40280613#comment10
These changes detect playback traversal of such a gap and issue a seek to flush the pipeline render. This prevents the stall and results in video frames being rendered that would not have otherwise (#5631).
The improvement in stall detection and immediate triggering of "bufferNudgeOnStall" when the media element is "waiting" addresses stalls on audio buffer gaps (#6169).
Are there any points in the code the reviewer needs to double check?
Are other gap-controller labelled issues addressed?
https://github.com/video-dev/hls.js/issues?q=is%3Aopen+is%3Aissue+label%3Agap-controller
The gap-controller now resembles other hls.js controllers in that it uses hls.js and media element events as well as a task interval to perform work. There are still a couple of places where it is dependent on the stream-controller that could be improved. For the most part this removes shared responsibility between the stream-controller and gap-controller.
Ex: all responsibility for emitting MEDIA_ENDED is contained in the gap-controller now.
Resolves issues:
Checklist