mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-06-24 08:48:37 +00:00
After a seek, hls_read_packet drops packets until each playlist reaches seek_timestamp. That threshold lives on c->first_timestamp's baseline, i.e. the DTS of whichever stream produced the very first packet. Streams can have different DTS baselines though. So comparing one stream's threshold against another stream's DTS is wrong. A stream whose first keyframe precedes the global baseline gets its segment keyframe dropped and resumes a segment (or more) late. Track the first DTS per playlist and rebase the threshold onto each playlist's own baseline. Since HLS segments are presentation-aligned across renditions, every stream then resumes at the same presentation time. seek_timestamp keeps its meaning on the global timeline, only the per-playlist comparison value is translated. This fixes playlists that would be unable to play from the start, and instead skip one or more segments, before data is output. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>