fix(manifests): rebase restarting timelines across dash periods and hls discontinuities

Shift tfdt of stitched DASH periods and HLS fVTT blocks, and WebVTT cues per period or block, so subtitles and timestamps stay in sync across ad breaks.
This commit is contained in:
imSp4rky
2026-11-23 10:51:40 -07:00
parent 9693cbd39c
commit 138782f38b
8 changed files with 711 additions and 18 deletions
+6
View File
@@ -370,6 +370,12 @@ A typical `get_tracks` therefore looks like fetching the manifest text with
- **DASH** enumerates tracks from only the *first* content period, but downloads segments
from *all* content periods matching the representation. The parser reads `SegmentTemplate`,
`SegmentList`, and `SegmentBase` addressing, and `$Number%0Nd$` padding.
When a period's fragment timeline starts again near 0, as in a stitched ad stream that
packages each part of the title on its own, the merge moves that period to follow the
periods it keeps before it. A timeline that continues is not changed, so the gaps of filtered ad
periods stay in it. Plain WebVTT periods and HLS subtitles across `EXT-X-DISCONTINUITY` blocks
get the same treatment: fVTT through its tfdt, and WebVTT through its cue times, which move to
the block's playlist start when that puts more cues inside the block.
- **HLS** re-fetches the media playlist at download time, recovers `SUPPLEMENTAL-CODECS`
from raw text (python-m3u8 drops it) to detect Dolby Vision composite streams, and uses
the media-sequence-number IV for AES-128 keys that have no explicit IV.