-
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 #240 #713
Fix #240 #713
Conversation
// It can take a few moments to get into the buffer | ||
if (!inBuffer) { | ||
d = new Date(); | ||
d.setSeconds(d.getSeconds() + 3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please explain this 3 seconds. Is it related to the chunk duration? Or is it for edge cases?
Hi @bbcrddave and @LloydW93 your provided alternate fix looks cleaner than ours (code wise), but when I was pulling your branch, I could still reproduce the original problem. I will describe the test case in detail:
That is the reason why we decided to go for the "prune the buffer on our own" solution as we only experienced bullet proofed stability if we never let the browser run into the buffer limit situation. |
Hey @bwidtmann, thanks for the feedback on this! The 3 seconds thing is actually a bad hack that I completely forgot about - it's there to handle the situation where a fragment has been downloaded, but is in dash.js' internal queue to be appended to the SourceBuffer. I'm going to take another look at this and replacing it with querying the virtual buffer instead of the media element directly, if possible. With the reproduction case, that's really interesting. I don't believe this is the case if you seek a short while into the content after that space has been pruned, so there is possibly a bug specifically around currentTime==0 case. I understand and agree with the general rationale of pruning the buffer on our own so that we have full control over these cases - I was just hoping (perhaps naively) that we should be able to expect browsers to perform in a vaguely predictable manner. Looking closely at both this PR and #633, there is nothing to suggest these are mutually exclusive changes - and indeed I think there are situations each cover which the other doesn't. |
merging both PRs is a quite good solution I never thought about 👍 regarding the reproducing: I just tried to seek back to another already appended time other than 0
but playback froze as well :-( what I experienced that the function isDiscarded never returns true when I put a console.log there |
@AkamaiDASH Please hold off merging this for now as we still need to make a couple more changes to address @bwidtmann's comments. We should have it sorted early next week. |
👍 - If it is much later then Monday then maybe needs to be voted on to get into 1.5 depending on the RC at the time...... Sure it will be fine. We just have this hard date this time with IBC... |
I've done some more playing with this lately, with some other changes I've made to make it more robust (they haven't yet been added to the branch this PR references). However, leaving the browser to handle buffer pruning once you look through and handle the other issues around it, in Chrome you start to encounter http://crbug.com/421694 - it will decide to evict buffer at the current playhead position so that it can append the next segment. |
Pulling out of 1.5 release. Revisit in next release. Merged #747 |
I'm going to close this PR for now. Will open a new one once we have decided on the best solution. |
This PR is a workaround issue #240. For more detail, see @LloydW93's comments on #633.
It's not perfect and in the long run we would expect there to be a better solution when a general clean up of fragment loading occurs, but at least seeking actually works when this patch is applied which we think is important for v1.5.