-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
TimeRangeUtils bufferedAheadOf breaks with >1 buffer #472
Comments
I'm sorry, this is working as intended. It was never intended to jump gaps that browsers will not jump at play time. Would changing this solve a problem for you? I'd be happy to discuss. |
Thanks @joeyparrish. I was playing around with some video that had small gaps due to the PTS/DTS bug, and the behavior seemed unexpected. Given that some browsers can recover from small gaps, doesn't it seem like the player should acknowledge media that's buffered past a gap? Is there an enhancement to be had here? I guess this is related to #180. |
Since we don't have any direct way to know how large a gap any given browser will jump, we can't really treat that media as buffered. StreamingEngine only queries the buffered range when initializing or switching streams, though, so small gaps should not be a problem while streaming. Once streaming begins, segments are fetched and appended in order without examining the buffered range. If a gap can be jumped, it will, and StreamingEngine won't notice. Where this breaks down is when you enter a buffering state (underflow). We don't exit that buffering state until a certain amount is buffered. Then we're checking the buffered range on an interval, and that condition may never be met due to the gap. |
Yeah, this popped up when I seeked to a point just before the start of a period that introduced a gap. The player would enter a buffering state, and it would never recover because it thought that it had nothing buffered ahead. Worse yet, it would try to buffer the same segments over and over again, which ultimately led to a Do you see a problem with Shaka behaving optimistically and assuming that the browser will play through the gap? It seems like it should honor |
That's a good point. We definitely shouldn't be re-requesting the same segment over and over. I don't see any reason we couldn't create a separate |
time and playhead time. This prevents streaming engine from requesting more segments if it encounters a gap. Related to #472. Change-Id: Ie9fac1b427b631ac467656c15fd8608e12c07efc
@baconz, we believe this is fixed now. Let us know if you have any further issues. |
This looks great @joeyparrish. Thanks. Wouldn't there still be a problem with getting into fetch-loops? Should a gap larger than |
We decided against throwing. There should be no fetch loop now that we have changed the way we compare against buffering goals. |
Sweet, sounds good. |
Commit that changes buffering goal comparison for reference. |
Imagine two buffers:
Given a time of 8, the current code would return a bufferedAhead of 2, when it should return 11.
I think something like this would fix it:
The text was updated successfully, but these errors were encountered: