diff options
author | Justin Ruggles <justinr@vimeo.com> | 2025-03-21 14:00:38 -0400 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2025-05-22 16:11:16 +0100 |
commit | 36ec9217e6dca3432304c9d76078d9618247eb0f (patch) | |
tree | 7d1b6c14ee778793b10263c8da4ba4c8b28a2361 /tests/utils.c | |
parent | c8b09fb0acc71b490ed9929210e6b29db42b0635 (diff) | |
download | ffmpeg-36ec9217e6dca3432304c9d76078d9618247eb0f.tar.gz |
avformat/dhav: fix backward scanning for get_duration and optimize seeking
The backwards scanning done for incomplete final packets should not
assume a specific alignment at the end of the file. Truncated files
result in hundreds of thousands of seeks if the final packet does not
fall on a specific byte boundary, which can be extremely slow.
For example, with HTTP, each backwards seek results in a separate
HTTP request.
This changes the scanning to check for the end tag 1 byte at a time
and buffers the last 1 MiB to avoid additional seek operations.
Co-authored-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Justin Ruggles <justinr@vimeo.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'tests/utils.c')
0 files changed, 0 insertions, 0 deletions