1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-20 07:48:15 +02:00
FFmpeg/libavformat
Marton Balint da74a74061 avformat/aviobuf: discard part of the IO buffer in ffio_ensure_seekback if needed
Previously ffio_ensure_seekback never flushed the buffer, so successive
ffio_ensure_seekback calls were all respected. This could eventually cause
unlimited memory and CPU usage if a demuxer called ffio_ensure_seekback on all
it's read data.

Most demuxers however only rely on being able to seek back till the position of
the last ffio_ensure_seekback call, therefore we change the semantics of
ffio_ensure_seekback so that a new call can invalidate seek guarantees of the
old. In order to support some level of "nested" ffio_ensure_seekback calls, we
document that the function only invalidates the old window (and potentially
discards the already read data from the IO buffer), if the newly requested
window does not fit into the old one.

This way we limit the memory usage for ffio_ensure_seekback calls requesting
consecutive data windows.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-10-09 21:07:18 +02:00
..
2020-10-03 21:50:59 +02:00
2020-10-06 00:01:35 +08:00
2020-10-06 00:01:27 +08:00
2020-09-25 10:21:28 +02:00
2020-10-07 22:16:09 +02:00
2020-09-24 13:38:28 +02:00
2020-09-18 11:30:03 +02:00
2020-09-03 18:11:00 +02:00
2020-09-20 18:03:52 +02:00
2020-09-03 18:03:18 +02:00
2020-09-13 16:05:01 +02:00