From 7cb4e3f91d561fe57021774ee4648aebbbdca7c1 Mon Sep 17 00:00:00 2001 From: Florent Bouisset Date: Wed, 23 Oct 2024 18:41:14 +0200 Subject: [PATCH] perform a seek to defreeze even if wanted position is higher than current --- src/main_thread/init/utils/rebuffering_controller.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main_thread/init/utils/rebuffering_controller.ts b/src/main_thread/init/utils/rebuffering_controller.ts index 23d12eab46..2cf50ad392 100644 --- a/src/main_thread/init/utils/rebuffering_controller.ts +++ b/src/main_thread/init/utils/rebuffering_controller.ts @@ -117,13 +117,10 @@ export default class RebufferingController extends EventEmitter UNFREEZING_SEEK_DELAY - ) { + if (now - referenceTimestamp > UNFREEZING_SEEK_DELAY) { log.warn("Init: trying to seek to un-freeze player"); this._playbackObserver.setCurrentTime( - this._playbackObserver.getCurrentTime() + UNFREEZING_DELTA_POSITION, + observation.position.getWanted() + UNFREEZING_DELTA_POSITION, ); prevFreezingState = { attemptTimestamp: now }; } @@ -477,7 +474,7 @@ function generateDiscontinuityError(stalledPosition: number, seekTo: number): Me "DISCONTINUITY_ENCOUNTERED", "A discontinuity has been encountered at position " + String(stalledPosition) + - ", seeked at position " + + ", seeking at position " + String(seekTo), ); }