From 7ac7444d229916249e9fb858ebed7ce883c7eeb8 Mon Sep 17 00:00:00 2001 From: "truong.hua" Date: Sun, 26 Jan 2025 23:18:36 +0700 Subject: [PATCH] Compatible with normal-latency stream even lowLatencyMode is enabled --- src/utils/level-helper.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/level-helper.ts b/src/utils/level-helper.ts index 121b6b13f97..24073645ad4 100644 --- a/src/utils/level-helper.ts +++ b/src/utils/level-helper.ts @@ -457,7 +457,8 @@ export function computeReloadInterval( distanceToLiveEdgeMs: number = Infinity, lowLatencyMode: boolean = false, ): number { - let reloadInterval = 1000 * (lowLatencyMode ? newDetails.partTarget : newDetails.targetduration); + const isLowLatency = lowLatencyMode && newDetails.partTarget; + let reloadInterval = 1000 * (isLowLatency ? newDetails.partTarget : newDetails.targetduration); if (newDetails.updated) { // When shorter than target duration and near live edge @@ -467,7 +468,7 @@ export function computeReloadInterval( const parts = newDetails.partList; const liveEdgeMaxTargetDurations = 4; if ( - lowLatencyMode && + isLowLatency && parts.length && newDetails.partHoldBack > distanceToLiveEdgeMs ) {