On Tue, Mar 21, 2023 at 02:37:28PM +0200, Martin Storsjö wrote: > Previously, the ff_configure_buffers_for_index function had > upper sanity limits of 16 MB (1<<24) for buffer_size and > 8 MB (1<<23) for short_seek_threshold. > > However, if the index analysis showed a need for even larger > buffer sizes (for a really badly interleaved file), over the > sanity limits, we previously didn't increase the buffer sizes > at all. > > Instead, if the file shows a need for really large buffers and > short_seek_threshold, just set them to the maximum sanity limit; > while it might not be enough for all cases in the file, it might > be enough for most of it. > > This can happen e.g. with a mov file with some tracks containing > some samples that belong in the start of the file, at the end of > the mdat, while the rest of the file is mostly reasonably interleaved; > previously those samples caused the maximum pos_delta to skyrocket, > skipping any buffer size enlargement. > > Signed-off-by: Martin Storsjö > --- > libavformat/seek.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) I think, if iam not too tired ATM that instead of taking the maximum it would be better to ignore the cases which are above the maximum, so the value would be optimal for the cases that it can help [...] thx -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is a danger to trust the dream we wish for rather than the science we have, -- Dr. Kenneth Brown