Skip to content

Commit

Permalink
Update audio-stream-controller to respect maxMaxBufferLength.
Browse files Browse the repository at this point in the history
This ensures that when maxMaxBufferLength is set to something smaller than,
maxBufferLength the value is respected for both audio and video.
  • Loading branch information
boushley committed Jan 25, 2018
1 parent 0bbf97a commit 24a1d7f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/controller/audio-stream-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,11 @@ class AudioStreamController extends TaskLoop {
bufferLen = bufferInfo.len,
bufferEnd = bufferInfo.end,
fragPrevious = this.fragPrevious,
// ensure we buffer at least config.maxBufferLength (default 30s)
// ensure we buffer at least config.maxBufferLength (default 30s) or config.maxMaxBufferLength (default: 600s)
// whichever is smaller.
// once we reach that threshold, don't buffer more than video (mainBufferInfo.len)
maxBufLen = Math.max(config.maxBufferLength,mainBufferInfo.len),
maxConfigBuffer = Math.min(config.maxBufferLength,config.maxMaxBufferLength),
maxBufLen = Math.max(maxConfigBuffer,mainBufferInfo.len),
audioSwitch = this.audioSwitch,
trackId = this.trackId;

Expand Down

0 comments on commit 24a1d7f

Please sign in to comment.