[FFmpeg-devel] [PATCH v2] avformat/dhav: fix backward scanning for get_duration and optimize seeking
Derek Buitenhuis
derek.buitenhuis at gmail.com
Wed May 21 16:23:16 EEST 2025
On 5/20/2025 8:18 PM, Andreas Rheinhardt wrote:
> The only thing that you want from parsing the end is the end timestamp
> and this is given by data alone. date is a 32bit le number at offset 16
> from the start of the dhav tag; it can be read directly from the buffer,
> so you do not need to seek again and use read_chunk to get the end.
> It also means that your ffio_ensure_seekback() is unnecessary (unless
> you wanted to ensure that the seek back to start_pos works (which is
> currently not guaranteed at all and not ensured by your code and would
> probably also be bad in general given that this would cache the whole
> file in memory).
Thanks for the review, v3 sent.
> (The above is based on the presumption that we are not really interested
> in what parse_ext() may parse in the chunk at the end; I don't know
> whether this is true or not.)
AFAICT, we are not.
Cheers,
- Derek
More information about the ffmpeg-devel
mailing list