From c0c86dfee1fdfa6e715ab5d27041bf79d67c84f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Kinasiewicz?= Date: Wed, 27 Jul 2022 17:21:04 +0200 Subject: [PATCH] Fix stalling when using buffer.fastSwitchEnabled setting 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. --- src/streaming/StreamProcessor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/streaming/StreamProcessor.js b/src/streaming/StreamProcessor.js index b2abe01e90..1771a62e88 100644 --- a/src/streaming/StreamProcessor.js +++ b/src/streaming/StreamProcessor.js @@ -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,