-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Setting backBufferLength to 0 does not remove old buffered media as expected. #6781
Comments
Hi @tmiller02. Thank you for the bug report. Can you expand on what the expected behavior is with both settings (0 and 1). HLS.js has to take care not to remove media from the buffer for the current GoP. If it removes the last IDR frame, media can be ejected at and past the playhead, interrupting video playback. So I'm curious to know if the back buffer length is being correctly capped at 3 target (or segment) durations in either case. This means we also need to know about your playlist target and segment durations and where removal is actually happening in either case. |
Hi Rob, Many thanks for your swift response. The issue is present on the demo site at https://hlsjs.video-dev.org/demo, with the Big Buck Bunny video where the target duration is set to 11 seconds. When However, when I would expect this to have worked in a similar way to when I suspect this might have been inadvertently introduced at 301be58#diff-c4df8184b8ec1cc3d6647f954f28fc69f8d7fe0d54d005ac37adf75b7ac5139bR695 where the check to flush the back buffer was changed from something like
to
but this means the new check will skip flushing the back buffer if |
@tmiller02 do you need this patched in v1.5(.18)? Would you be willing to submit a fix? |
What version of Hls.js are you using?
1.5.16
What browser (including version) are you using?
Chrome 129.0.6668.100
What OS (including version) are you using?
macOS Sonoma
Test stream
No response
Configuration
Additional player setup steps
No response
Checklist
Steps to reproduce
backBufferLength
to 0 and applyExpected behaviour
The docs at https://github.com/video-dev/hls.js/blob/master/docs/API.md#backbufferlength state that setting
backBufferLength
to 0 should keep the minimum amount.What actually happened?
Much more of the media buffer is kept than expected. However, setting the
backBufferLength
to a small value such as 1 does produce the expected behaviour.This issue is potentially due to a change at https://github.com/video-dev/hls.js/blame/2fa668f9978673f86f6020dfe7bbc24c748f46e3/src/controller/buffer-controller.ts#L1130 the check for flushing the back buffer was changed to only apply if
backBufferLength
is greater than 0.Console output
Chrome media internals output
No response
The text was updated successfully, but these errors were encountered: