mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-14 15:56:38 +03:00
d3dfabceb1
When a multi-period DASH manifest contains periods which are in the future (described in the manifest, but with all segments past the current end time of the segment availability window), the segments generated for SegmentTemplate were invalid. Not all DASH multi-period content describes unavailable future periods, so many providers using DASH would not see this issue. This bug affected v3.0.0 - v3.0.7. To fix this, we change the "next position" calculation for updates to clamp to the minimum valid position. This avoids creating segment references with negative position numbers for these future periods. When the segment availability window moves to include this period, we will then start generating segments for it (starting at position 0 or whatever the startNumber attribute is for this period). However, the contract for updateEvery() in SegmentIndex was such that the timer would stop if the list of references was every empty. This was meant to handle the case in which all segments were evicted, but it could be triggered instantly on these "future" periods, for which no segments exist yet in the availability window. To resolve this, the contract was changed so that the updateEvery() callback must explicitly signal a stop by returning null instead of an array of segment references. Bug: 179025415 Change-Id: I56a2826fd3aea3f69da7b8bf4fa7629562d63506