[FFmpeg-devel] [PATCH] avformat/mov: Reduce seek when interleaved_read is disabled

Zhao Zhili quinkblack at foxmail.com
Wed Apr 23 12:20:06 EEST 2025



> On Apr 17, 2025, at 20:12, Zhao Zhili <quinkblack at foxmail.com> wrote:
> 
> From: Zhao Zhili <zhilizhao at tencent.com>
> 
> Don't select sample with small dts when interleaved_read is disabled.
> ---
> 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;
> -- 
> 2.46.0

Will apply this week.


More information about the ffmpeg-devel mailing list