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

Fix for SourceBuffer full error handling #5332

Merged
merged 1 commit into from Mar 24, 2023

Conversation

robwalch
Copy link
Collaborator

This PR will...

Manage appendBuffer SourceBuffer full errors correctly when audio bitrate is higher than video..

Why is this Pull Request needed?

When the audio bitrate is higher than the video bitrate, SourceBuffer full errors can occur on the audio buffer as the audio-stream-controller tries to keep up with the video buffer length.

The audio-stream-controller was going past maxMaxBufferLength when the video buffer exceeded that length prior to its value being reduced after the first buffer full error. Further more, the max length was not being reduced more than the current buffer length on the second error at which point the entire buffer was flushed. The entire buffer should only be flushed when the buffer that errored is starved (to remove back and forward buffer not used for playback).

Resolves issues:

Fixes #5328

@robwalch robwalch added this to the 1.4.0 milestone Mar 24, 2023
@robwalch
Copy link
Collaborator Author

@pateljoel Please let me know if this change fixes the issue for you.

@pateljoel
Copy link

@robwalch Just tried this change on the bugfix/audio-source-buffer-full I don't think it worked.

I'm using Chrome on MacOS

Screenshot 2023-03-24 at 08 40 31

@robwalch
Copy link
Collaborator Author

The error is expected.

Before this change, this error occurred multiple times. The internal error response flushed the audio buffer which interfered with playback.

Now, the append error occurs once, the audio buffer is not flushed, and playback continues but with a forward buffer limited to a maximum of five minutes instead of ten.

@robwalch robwalch merged commit 651fbd5 into master Mar 24, 2023
16 checks passed
@robwalch robwalch deleted the bugfix/audio-source-buffer-full branch March 24, 2023 16:27
@robwalch
Copy link
Collaborator Author

Merged for v1.4.0-beta.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bufferStalled Error on Vimeo HLS Video
2 participants