Skip to content

Commit

Permalink
for lldash use min/max playbackRate when the buffer is safe in mode: …
Browse files Browse the repository at this point in the history
…liveCatchupModeLoLP (#4322)
  • Loading branch information
bwallberg committed Dec 5, 2023
1 parent 01117ab commit 7025589
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/streaming/controllers/CatchupController.js
Expand Up @@ -393,14 +393,14 @@ function CatchupController() {
logger.debug('[LoL+ playback control_buffer-based] bufferLevel: ' + bufferLevel + ', newRate: ' + newRate);
} else {
// Hybrid: Latency-based
// Buffer is safe, vary playback rate based on latency
const cpr = liveCatchUpPlaybackRates.max;
// Check if latency is within range of target latency
const minDifference = 0.02;
if (Math.abs(currentLiveLatency - liveDelay) <= (minDifference * liveDelay)) {
newRate = 1;
} else {
const deltaLatency = currentLiveLatency - liveDelay;
// Buffer is safe, vary playback rate based on latency
const cpr = (deltaLatency < 0) ? Math.abs(liveCatchUpPlaybackRates.min) : liveCatchUpPlaybackRates.max;
const d = deltaLatency * 5;

// Playback rate must be between (1 - cpr) - (1 + cpr)
Expand Down

0 comments on commit 7025589

Please sign in to comment.