Skip to content

Commit d1ccff3

Browse files
committed
Rename function-level variable for clarity
- removes potential for ambiguity between liveDelay variable in startPlaybackCatchUp function and PlaybackController module when reasoning about the code - new name intended to convey that the player's liveDelay value is used throughout this function
1 parent 5344e42 commit d1ccff3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/streaming/controllers/PlaybackController.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,8 +629,8 @@ function PlaybackController() {
629629
function startPlaybackCatchUp() {
630630
if (videoModel) {
631631
const cpr = settings.get().streaming.liveCatchUpPlaybackRate;
632-
const liveDelay = mediaPlayerModel.getLiveDelay();
633-
const deltaLatency = getCurrentLiveLatency() - liveDelay;
632+
const playerLiveDelay = mediaPlayerModel.getLiveDelay();
633+
const deltaLatency = getCurrentLiveLatency() - playerLiveDelay;
634634
const d = deltaLatency * 5;
635635
// Playback rate must be between (1 - cpr) - (1 + cpr)
636636
// ex: if cpr is 0.5, it can have values between 0.5 - 1.5
@@ -641,7 +641,7 @@ function PlaybackController() {
641641
// just cause more and more stall situations
642642
if (playbackStalled) {
643643
const bufferLevel = getBufferLevel();
644-
if (bufferLevel > liveDelay / 2) {
644+
if (bufferLevel > playerLiveDelay / 2) {
645645
playbackStalled = false;
646646
} else if (deltaLatency > 0) {
647647
newRate = 1.0;

0 commit comments

Comments
 (0)