Bug 1974237 Comment 6 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Looking a bit into the track mode setter, the problem is:
- For *each* cue (~39k of them) in the (unsorted) cue list:
  - [Notify the media element it was added or removed](https://searchfox.org/mozilla-central/rev/de87ab8fb7d046a068943d4728a2345568ff77c5/dom/media/webvtt/TextTrack.cpp#92,97), depending on mode.
  - [Add or Remove it from the list of *active* cues](https://searchfox.org/mozilla-central/rev/de87ab8fb7d046a068943d4728a2345568ff77c5/dom/media/webvtt/TextTrack.cpp#266,272), depending on mode.
  - What is the list of active cues? A [time-sorted (`media::TimeUnit`) list](https://searchfox.org/mozilla-central/rev/de87ab8fb7d046a068943d4728a2345568ff77c5/dom/media/webvtt/TextTrackCueList.cpp#74)! And we add elements one by one! Geeee

And of course, if dash.js kept, say, 100 cues in the track at any given time instead of 39k, this wouldn't be a user-observable problem.
~~Looking a bit into the track mode setter, the problem is:~~
- ~~For *each* cue (\~39k of them) in the (unsorted) cue list:~~
  - ~~[Notify the media element it was added or removed](https://searchfox.org/mozilla-central/rev/de87ab8fb7d046a068943d4728a2345568ff77c5/dom/media/webvtt/TextTrack.cpp#92,97), depending on mode.~~
  - ~~[Add or Remove it from the list of *active* cues](https://searchfox.org/mozilla-central/rev/de87ab8fb7d046a068943d4728a2345568ff77c5/dom/media/webvtt/TextTrack.cpp#266,272), depending on mode.~~
  - ~~What is the list of active cues? A [time-sorted (`media::TimeUnit`) list](https://searchfox.org/mozilla-central/rev/de87ab8fb7d046a068943d4728a2345568ff77c5/dom/media/webvtt/TextTrackCueList.cpp#74)! And we add elements one by one! Geeee~~

And of course, if dash.js kept, say, 100 cues in the track at any given time instead of 39k, this wouldn't be a user-observable problem.

edit: nope, the list of active cues use `double` for sorting, so the `TimeUnit` operations come in elsewhere.

Back to Bug 1974237 Comment 6