Skip to content
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 regression: prevent wrapping in resetMainLoaderReplaceSegments #1439

Merged
merged 1 commit into from
Oct 30, 2023
Merged

fix regression: prevent wrapping in resetMainLoaderReplaceSegments #1439

merged 1 commit into from
Oct 30, 2023

Conversation

pulsejet
Copy link
Contributor

This fixes a regression introduced in 4590bdd

If the quality is changed during initialization, this function is called. Since buffered.length is zero and buffered is a TimeRanges, length (an unsigned long) wraps around and becomes 4294967295

PsVideo.ts:462 DOMException: Failed to execute 'end' on 'TimeRanges': The index provided (4294967295) is greater than the maximum bound (0).
    at PlaylistController.resetMainLoaderReplaceSegments (http://localhost:8035/apps/memories/js/memories-vendors-node_modules_plyr_dist_plyr_css-node_modules_video_js_dist_video-js_min_css-node_modu-82e78d.js?v=7e8851a5e7ef114c9398:65070:34)
    at PlaylistController.fastQualityChange_ (http://localhost:8035/apps/memories/js/memories-vendors-node_modules_plyr_dist_plyr_css-node_modules_video_js_dist_video-js_min_css-node_modu-82e78d.js?v=7e8851a5e7ef114c9398:65060:10)
    at QualityLevel.enabled_ (http://localhost:8035/apps/memories/js/memories-vendors-node_modules_plyr_dist_plyr_css-node_modules_video_js_dist_video-js_min_css-node_modu-82e78d.js?v=7e8851a5e7ef114c9398:66129:5)
    at QualityLevel.set (http://localhost:8035/apps/memories/js/memories-vendors-node_modules_plyr_dist_plyr_css-node_modules_video_js_dist_video-js_min_css-node_modu-82e78d.js?v=7e8851a5e7ef114c9398:42975:15)
    at VideoContentSetup.changeQuality (http://localhost:8035/apps/memories/js/memories-main.js:60373:40)

This fixes a regression introduced in 4590bdd

If the quality is changed during initialization, this function is called. Since `buffered.length` is zero and `buffered` is a `TimeRanges`, `length` (an `unsigned long`) wraps around and becomes 4294967295
@welcome
Copy link

welcome bot commented Oct 27, 2023

💖 Thanks for opening this pull request! 💖

Things that will help get your PR across the finish line:

  • Run npm run lint -- --errors locally to catch formatting errors earlier.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@pulsejet
Copy link
Contributor Author

@adrums86

pulsejet added a commit to pulsejet/memories that referenced this pull request Oct 27, 2023
Copy link
Contributor

@adrums86 adrums86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! LGTM.

@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

Merging #1439 (577f70d) into main (beccfa1) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1439   +/-   ##
=======================================
  Coverage   85.94%   85.94%           
=======================================
  Files          42       42           
  Lines       10436    10436           
  Branches     2414     2415    +1     
=======================================
  Hits         8969     8969           
  Misses       1467     1467           
Files Coverage Δ
src/playlist-controller.js 95.80% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@adrums86 adrums86 merged commit 719b7f4 into videojs:main Oct 30, 2023
@welcome
Copy link

welcome bot commented Oct 30, 2023

Congrats on merging your first pull request! 🎉🎉🎉

@pvieira91
Copy link

pvieira91 commented Oct 31, 2023

First of all thanks for the work you have been doing. We've been using video.js for some years and it's fantastic. Since we started using HLS we started to get some errors in sentry. I believe this commit fixes our issue. Can you please tell me when a new version will be released?

Thanks

IndexSizeError: Failed to execute 'end' on 'TimeRanges': The index provided (4294967295) is greater than the maximum bound (0).
  at Mf.resetMainLoaderReplaceSegments (/public/frontend/_assets/videojs.2328859c5a34d65c05ea1c.js:181:38223)

dzianis-dashkevich pushed a commit that referenced this pull request Nov 30, 2023
dzianis-dashkevich added a commit that referenced this pull request Dec 4, 2023
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants