-
Notifications
You must be signed in to change notification settings - Fork 426
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: fastQualityChange refactor #1414
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1414 +/- ##
==========================================
+ Coverage 85.55% 85.61% +0.05%
==========================================
Files 41 41
Lines 10145 10159 +14
Branches 2351 2352 +1
==========================================
+ Hits 8680 8698 +18
+ Misses 1465 1461 -4
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I found a bug where, if there is > 1 segment buffered, the player will switch back to that segment (sometimes at reduced quality) when switching.I have a fix almost complete that I will push ASAP and tag all reviewers for another look. |
@dzianis-dashkevich @wseymour15 This could use another look after the latest commit 4639842 (forgot to push the test fixes 😁 ) |
@adrums86 is it a known bug that the new code might fail if nothing is buffered? I guess this happens because nothing is buffered. Could we early return from that function if that's the case? |
This reverts commit 4590bdd.
…rEachSegment and remove replaceSegmentsUntil (#1457) * Revert "fix: check for transmuxer for vtt-segment-loader (#1452)" This reverts commit b4dd748. * Revert "fix: fix several issues with calculate timestamp offset for each segment (#1451)" This reverts commit 3bbc6ef. * Revert "fix: replaceSegmentsUntil flag resetting too early (#1444)" This reverts commit af39ba5. * Revert "fix: prevent wrapping in resetMainLoaderReplaceSegments (#1439)" This reverts commit 719b7f4. * Revert "feat: Add feature flag to calculate timestampOffset for each segment to handle streams with corrupted pts or dts timestamps (#1426)" This reverts commit 2355ddc. * Revert "fix: fastQualityChange refactor (#1414)" This reverts commit 4590bdd. * cherry-pick: use transmuxer time info instead of probeTs * feat: sync controller media sequence strategy (#1458) * feat: add media sequence sync strategy * fix: fix current media sequence increment * chore: update logs * feat: use exact segment match in sync-controller * fix: fix race condition for a fast quality switch * chore: add additional logs for choose next request * feat: force timestamp after resync * chore: fix or skip tests * Update src/segment-loader.js Co-authored-by: Walter Seymour <[email protected]> --------- Co-authored-by: Dzianis Dashkevich <[email protected]> Co-authored-by: Walter Seymour <[email protected]> --------- Co-authored-by: Dzianis Dashkevich <[email protected]> Co-authored-by: Walter Seymour <[email protected]>
Description
fastQualityChange_
was causing unnecessary rebuffering and requesting cached segments. This was resulting in slow and very buggy playlist changes. This was because it was callingresetEverything
on the mainSegmentLoader, then callingsetCurrentTime
which callsresetEverything
again on ALL the segment loaders, which removes all content from the buffer and aborts all requests.Edit: Had to add a property
replaceSegmentsUntil
, which represents the end of the buffer at the momentfastQualityChange_
is called. This tells the segment loader to leavefetchAtBuffer_
as false until we've successfully replaced all the buffered segments betweencurrentTime
andbufferedEnd
at the momentfastQualityChange_
is called.Specific Changes proposed
Remove the
resetEverything
andsetCurrentTime
call fromfastQualityChange_
and instead reset the next segment position tocurrentTime
with aresetLoader
call, keeping the current buffer and overwriting it.Requirements Checklist