Skip to content

Commit

Permalink
refactor: add a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
WofWca committed Jan 1, 2023
1 parent 01cd0df commit 186da5d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ export default class Controller {
// Cry about it.
this._didNotDoDesyncCorrectionForNSpeedSwitches++;
if (this._didNotDoDesyncCorrectionForNSpeedSwitches >= DO_DESYNC_CORRECTION_EVERY_N_SPEED_SWITCHES) {
// `+=` actually makes more sense to me here because the past frames might get
// discarded by the browser and maybe it'll have to re-buffer them. But
// based on a bit of testing using seeking with `+=` took 132ms on average,
// while `-=` 103.6. So I'll not be touching it for now.
element.currentTime -= 1e-9;
// TODO but it's also corrected when the user seeks the video manually.
this._didNotDoDesyncCorrectionForNSpeedSwitches = 0;
Expand Down

0 comments on commit 186da5d

Please sign in to comment.