mirror of
https://github.com/androidx/media.git
synced 2025-05-03 21:57:46 +08:00

When switching format in HLS, we instantiate a new extractor, which adjusts TS presentation timestamps so that they align properly with the start of the first segment in the new format. Some HLS streams appear to have slightly misalignment that causes a glitch when using this approach. It's better to re-use the same timestamp adjustment across formats, and only reset it when seeking or when there's an actual discontinuity. This is because the HLS spec guarantees PTS timestamp alignment across different formats. We'll also need something like PtsTimestampAdjuster to share between separated audio and WebVTT tracks, which also contain PTS timestamps that are aligned, and will need to share a common adjustment. Issue: #692