From 7faf5b0e02734313091b5672b861044ef90ea592 Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Thu, 1 Apr 2021 11:19:13 +0200 Subject: Fix condition for ffmpeg seek workaround This condition was in contradiction with comment for function `ffmpeg_generic_seek_workaround()`. I have noticed, that formats that seeked well used this workaround. Problem was that I misunderstood code from `av_seek_frame()` - formats with `read_seek()` function stil don't use generic seeking method. This is defined in `seek_frame_internal()` --- source/blender/imbuf/intern/anim_movie.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/blender/imbuf/intern') diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 1d14f7567c4..6c63c1a1b5b 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -1219,8 +1219,7 @@ static void ffmpeg_seek_and_decode(struct anim *anim, int position, struct anim_ AVFormatContext *format_ctx = anim->pFormatCtx; - /* Condition based on av_seek_frame() code. */ - if (format_ctx->iformat->read_seek2 && !format_ctx->iformat->read_seek) { + if (format_ctx->iformat->read_seek2 || format_ctx->iformat->read_seek) { ret = av_seek_frame(anim->pFormatCtx, -1, pos, AVSEEK_FLAG_BACKWARD); } else { -- cgit v1.2.3