Skip to content

Commit

Permalink
fix(latency-controller): only sync live stream
Browse files Browse the repository at this point in the history
  • Loading branch information
FredZeng authored and robwalch committed Dec 13, 2023
1 parent fc8bd4d commit d3845c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/controller/latency-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,11 @@ export default class LatencyController implements ComponentAPI {

// Adapt playbackRate to meet target latency in low-latency mode
const { lowLatencyMode, maxLiveSyncPlaybackRate } = this.config;
if (!lowLatencyMode || maxLiveSyncPlaybackRate === 1) {
if (
!lowLatencyMode ||
maxLiveSyncPlaybackRate === 1 ||
!levelDetails.live
) {
return;
}
const targetLatency = this.targetLatency;
Expand All @@ -222,8 +226,8 @@ export default class LatencyController implements ComponentAPI {
targetLatency + levelDetails.targetduration,
);
const inLiveRange = distanceFromTarget < liveMinLatencyDuration;

if (
levelDetails.live &&
inLiveRange &&
distanceFromTarget > 0.05 &&
this.forwardBufferLength > 1
Expand Down

0 comments on commit d3845c2

Please sign in to comment.