Skip to content

Commit

Permalink
Compatible with normal-latency stream even lowLatencyMode is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
truong-hua committed Jan 26, 2025
1 parent cc1a65e commit 7ac7444
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/level-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -467,7 +468,7 @@ export function computeReloadInterval(
const parts = newDetails.partList;
const liveEdgeMaxTargetDurations = 4;
if (
lowLatencyMode &&
isLowLatency &&
parts.length &&
newDetails.partHoldBack > distanceToLiveEdgeMs
) {
Expand Down

0 comments on commit 7ac7444

Please sign in to comment.