mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-26 17:46:26 +03:00
42df30a84e
This pull request improves support for external SIDX (Segment Index) files in DASH manifests, particularly when the `RepresentationIndex` uses a different `BaseURL` or `sourceURL` than the media itself. It also enhances base64 decoding robustness and adds a new unit test to verify correct behavior. **DASH SIDX and Segment Reference Handling:** * Enhanced `Mp4SegmentIndexParser.parse` to accept an `indexIsExternal` parameter, enabling correct parsing of SIDX files that are external to the media and may have different base URIs. The parser now adjusts the offset logic for external indices. [[1]](diffhunk://#diff-6435d27cfd56024b0920175aa9a6992242d18900d27f7edfaa77d89673a8dd0aR29-R37) [[2]](diffhunk://#diff-6435d27cfd56024b0920175aa9a6992242d18900d27f7edfaa77d89673a8dd0aR54-L63) * Addresses #6091: Updated `SegmentBase.generateSegmentIndexFromUris` to detect when the index URI is external by comparing the base URIs, and to pass this information to the parser. This ensures that segment references are resolved against the correct URIs. **Robustness Improvements:** * Improved base64 decoding in `Uint8ArrayUtils.fromBase64` by normalizing padding, handling cases where the input string omits trailing `=` characters. **Testing Enhancements:** * Added a unit test to verify that `RepresentationIndex` with a different `BaseURL` or `sourceURL` is correctly honored, ensuring that segment index requests use the proper URI and range. --------- Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>