[Bf-blender-cvs] [7faf5b0e027] master: Fix condition for ffmpeg seek workaround

Richard Antalik noreply at git.blender.org
Thu Apr 1 11:30:31 CEST 2021


Commit: 7faf5b0e02734313091b5672b861044ef90ea592
Author: Richard Antalik
Date:   Thu Apr 1 11:19:13 2021 +0200
Branches: master
https://developer.blender.org/rB7faf5b0e02734313091b5672b861044ef90ea592

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()`

===================================================================

M	source/blender/imbuf/intern/anim_movie.c

===================================================================

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 {



More information about the Bf-blender-cvs mailing list