Commit Graph

2 Commits

Author SHA1 Message Date
Chad Michael 42df30a84e fix(DASH): Handle external SegmentBase BaseURL and SIDX offset fallback (#9477)
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>
2025-12-12 10:25:08 +01:00
Álvaro Velad Galván defea159de build: Move some types to improve the build size (#8096) 2025-02-18 11:02:49 +01:00