Skip to content

Commit

Permalink
Fix stalling when using buffer.fastSwitchEnabled setting
Browse files Browse the repository at this point in the history
According to the docs in Settings, the value used by StreamProcessor was wrong.
The problem occurred on an environment with high latency and low bandwidth, where segments' length was 3s, which is significantly longer than previously hardcoded 1.5s.
  • Loading branch information
lkinasiewicz committed Jul 28, 2022
1 parent 176796e commit 3db7cbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/streaming/StreamProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ function StreamProcessor(config) {
function _prepareForFastQualitySwitch(representationInfo) {
// if we switch up in quality and need to replace existing parts in the buffer we need to adjust the buffer target
const time = playbackController.getTime();
let safeBufferLevel = 1.5;
let safeBufferLevel = 1.5 * !isNaN(representationInfo.fragmentDuration) ? representationInfo.fragmentDuration : 1;
const request = fragmentModel.getRequests({
state: FragmentModel.FRAGMENT_MODEL_EXECUTED,
time: time + safeBufferLevel,
Expand Down

0 comments on commit 3db7cbd

Please sign in to comment.