-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: ignore buffered content less than 1e-4s #6802
fix: ignore buffered content less than 1e-4s #6802
Conversation
On Firefox, in some cases after a period ends, seeking shortly after will cause playback to fail or stall. This occurs when the next period has small gaps and we're seeking to after the gap. Seeking to before the gap succeeds. Even though the seek requests the soure buffers to be fully cleared, Firefox actually keeps around less than 1e-4s of content and won't let us forcibly remove this content. Trying to call flush causes in infinite loop. This leftover content makes shaka think that the buffer end in where we used to be even though the presentation time reflects where we seeked to. This means that playback doesn't continue. The buffer contitues getting filled and playback will either fail when the SourcBuffer is filled and triggers a QuotaExceededError or contiue when the buffer will reach the presentationTime.
Incremental code coverage: 100.00% |
lib/media/time_ranges_utils.js
Outdated
@@ -23,7 +23,8 @@ shaka.media.TimeRangesUtils = class { | |||
return null; | |||
} | |||
// Workaround Safari bug: https://bit.ly/2trx6O8 | |||
if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) { | |||
// Firefox may leave <1e-4s of data in buffer after clearing all content | |||
if (b.length == 1 && b.end(0) - b.start(0) < 1e-4) { |
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.
There are lots of those checks... Maybe move it to some util function so in the future we will not be forced to change the same value all over the place?
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.
Yes, I agree, please move the check to a helper function or at least move the value to a constant. Thanks!
lib/media/time_ranges_utils.js
Outdated
@@ -23,7 +23,8 @@ shaka.media.TimeRangesUtils = class { | |||
return null; | |||
} | |||
// Workaround Safari bug: https://bit.ly/2trx6O8 | |||
if (b.length == 1 && b.end(0) - b.start(0) < 1e-6) { | |||
// Firefox may leave <1e-4s of data in buffer after clearing all content | |||
if (b.length == 1 && b.end(0) - b.start(0) < 1e-4) { |
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.
Yes, I agree, please move the check to a helper function or at least move the value to a constant. Thanks!
On Firefox, in some cases after a period ends, seeking shortly after will cause playback to fail or stall. This occurs when the next period has small gaps and we're seeking to after the gap. Seeking to before the gap succeeds. Even though the seek requests the soure buffers to be fully cleared, Firefox actually keeps around less than 1e-4s of content and won't let us forcibly remove this content. Trying to call flush causes in infinite loop. This leftover content makes shaka think that the buffer end in where we used to be even though the presentation time reflects where we seeked to. This means that playback doesn't continue. The buffer contitues getting filled and playback will either fail when the SourcBuffer is filled and triggers a QuotaExceededError or contiue when the buffer will reach the presentationTime.
On Firefox, in some cases after a period ends, seeking shortly after will cause playback to fail or stall. This occurs when the next period has small gaps and we're seeking to after the gap. Seeking to before the gap succeeds. Even though the seek requests the soure buffers to be fully cleared, Firefox actually keeps around less than 1e-4s of content and won't let us forcibly remove this content. Trying to call flush causes in infinite loop. This leftover content makes shaka think that the buffer end in where we used to be even though the presentation time reflects where we seeked to. This means that playback doesn't continue. The buffer contitues getting filled and playback will either fail when the SourcBuffer is filled and triggers a QuotaExceededError or contiue when the buffer will reach the presentationTime.
On Firefox, in some cases after a period ends, seeking shortly after will cause playback to fail or stall.
This occurs when the next period has small gaps and we're seeking to after the gap. Seeking to before the gap succeeds. Even though the seek requests the soure buffers to be fully cleared, Firefox actually keeps around less than 1e-4s of content and won't let us forcibly remove this content. Trying to call flush causes in infinite loop.
This leftover content makes shaka think that the buffer end in where we used to be even though the presentation time reflects where we seeked to. This means that playback doesn't continue. The buffer contitues getting filled and playback will either fail when the SourcBuffer is filled and triggers a QuotaExceededError or contiue when the buffer will reach the presentationTime.