Opened 11 years ago

Closed 11 years ago

#2316 closed defect (duplicate)

Provide a seeking API that works for files with discontinuous timestamps

Reported by: gjdfgh Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked 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

Change History (1)

comment:1 by Carl Eugen Hoyos, 11 years ago

Resolution: duplicate
Status: newclosed

Afaict, this is a duplicate of ticket #1438, I suggest to retest this ticket here once #1438 is fixed.

Note: See TracTickets for help on using tickets.