Ticket #2316 (closed defect: duplicate)
Provide a seeking API that works for files with discontinuous timestamps
|Reported by:||gjdfgh||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
Some formats (like MPEG stuff) can have discontinuous timestamps. This means the data stream is partitioned into segments of packets with monotonically increasing TS, but when crossing the segment boundaries, the TS changes to another arbitrary value. It's well possible that two segments use exactly the same timestamps.
This completely breaks the seeking API, which is based on absolute timestamps. There is AVSEEK_FLAG_BYTE too, but that has lower precission, and doesn't even work for some formats (consider chained OGG).
Note that even if timestamps are unique, seeking probably doesn't work well with such files (I haven't actually tested it, but binary search will obviously break?).
Please extend the seeking API so that this works. I see a few possibilities:
- add generation of linear, monotonically increasing PTS, and use that for seeking
- add the ability to do relative seeks
- fix AVSEEK_FLAG_BYTE for all demuxers that report it as supported, and support it for all demuxers that support discontinuous TS