mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-26 17:46:26 +03:00
3cdb9c8e16
As part of Period-flattening, I'm trying to reduce our dependence on the "position" field of SegmentReference. If it can be eliminated, we can more easily concatenate Arrays of SegmentReferences without modifying them. There has long been a comment at the top of SegmentIndex's merge method stating that we only ever extend the references, but never interleave them. The code, however, is structured in such a way that it could interleave them. This could cause the offset of a given SegmentReference in the Array to change, which would be counter to the comment about only ever extending the list. This change simplifies merge() so that it can only ever extend the array of SegmentReferences. This will guarantee that their offset within the Array will not change during the merge operation. This, in turn, enables further SegmentIndex changes to move "next" segment tracking out of StreamingEngine (where it is based on the "position" field of SegmentReference) and into SegmentIndex (where it could be based on offset into the Array of references). It removes one test related to PR #838. This test was about our ability to update the position of the final segment in a list. This doesn't seem to make a lot of sense, and we're going to stop relying on segment position anyway. Issue #1339 (period-flattening) Change-Id: I2067e2266cf2d02c0e6350d6b57d74f9ed1b27d3