From ca964ba139695fc0064d07ac6503626d549520c7 Mon Sep 17 00:00:00 2001 From: Zhao Zhili Date: Thu, 17 Apr 2025 20:12:49 +0800 Subject: [PATCH] avformat/mov: Reduce seek when interleaved_read is disabled Don't select sample with small dts when interleaved_read is disabled. Signed-off-by: Zhao Zhili --- libavformat/mov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 452690090c..cb81b6c4da 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -10703,7 +10703,7 @@ static AVIndexEntry *mov_find_next_sample(AVFormatContext *s, AVStream **st) ((s->pb->seekable & AVIO_SEEKABLE_NORMAL) && ((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb && dts != AV_NOPTS_VALUE && ((dtsdiff <= AV_TIME_BASE && current_sample->pos < sample->pos) || - (dtsdiff > AV_TIME_BASE && dts < best_dts)))))) { + (dtsdiff > AV_TIME_BASE && dts < best_dts && mov->interleaved_read)))))) { sample = current_sample; best_dts = dts; *st = avst;