mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-26 17:46:26 +03:00
45a86cacd5
During a variant switch in HLS live content, shaka may take ~1 second to create a new segment index (due to network calls). During this window, the number of active streams temporarily drops to zero. When update() runs in this state, lastTargetDuration_ gets set to Infinity because there are no active streams to reduce it. This causes getUpdatePlaylistDelay_() to return Infinity, so updatePlaylistTimer_.tickAfter(Infinity) is called, effectively stopping manifest updates forever. Fix this with two guards: 1. In update(): return early when there are no active streams, before setting lastTargetDuration_ to Infinity. 2. In onUpdate_(): if finalDelay is Infinity or NaN, use a 1-second fallback delay instead of scheduling with a non-finite value.