-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 seeking issue #2973
Fix seeking issue #2973
Conversation
…t appending is achieved
Totally makes sense, @bbert. I think we should do the same in the part of the code where we are managing quota exceed situations, isn't it? Alternatively, to cover both cases and possible future ones, we could move the checking business logic within pruneAllSafely method. What do you think? |
@epiclabsDASH Yes, this can be achieved this way indeed, but this requires having sourceBufferSink::waitForUpdateEnd() method to be public. |
I was talking about moving this logic within pruneAllSafely() if (buffer.getBuffer().updating) {
seeking = true;
} else {
pruneAllSafely();
} Anyway, your approach looks ok to me. Requires BufferController to know it should wait for pruning all buffer but implementation overall implementation looks cleaner. Just one last thing. We need to add the waitForUpdateEnd method also to the PreBufferSink class. |
OK, I've missed the PreBufferSink. |
Looks ok to me! Regarding prefetch, there is a pending task to improve how it works (from the UI/interface point of view) so you don't need to click two times to attach button of the demo to start playback. Anyway, not related with your change at all. Thanks! |
BufferController: when seeking, prune buffer only once current segment appending is achieved
In BufferController, when seeking, a segment may being appended into the buffer.
Therefore if we do prune the buffer before the current segment appending process is completed, then the range to be removed is erroneous (does not take into account current segment being appended).
This can have side effects and leads to playback freeze.
On some devices, appending process can take a relatively long time and can more easily highlight this issue.
This PR attempts to fix this issue by waiting for segment appending process to be completed before pruning the buffer at seeking.