Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flush MSE rendering pipeline when crossing video buffer holes with audio #6972

Merged
merged 5 commits into from
Feb 1, 2025

Conversation

robwalch
Copy link
Collaborator

@robwalch robwalch commented Jan 24, 2025

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

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

@robwalch robwalch added this to the 1.6.0 milestone Jan 24, 2025
@robwalch robwalch linked an issue Jan 31, 2025 that may be closed by this pull request
5 tasks
@robwalch robwalch merged commit 305a3a7 into master Feb 1, 2025
15 of 16 checks passed
@robwalch robwalch deleted the feature/gap-controller-flush-pipeline branch February 1, 2025 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant