[Bf-blender-cvs] [6fe2d6b8c8e] master: Fix freezed proxy frames

Richard Antalik noreply at git.blender.org
Thu Apr 1 10:46:29 CEST 2021


Commit: 6fe2d6b8c8ebd9566d27b92a890cc4fc1e7d5d1e
Author: Richard Antalik
Date:   Thu Apr 1 10:30:22 2021 +0200
Branches: master
https://developer.blender.org/rB6fe2d6b8c8ebd9566d27b92a890cc4fc1e7d5d1e

Fix freezed proxy frames

`ffmpeg_generic_seek_workaround()` applied negative offset for seqrched
packet timestamp, but proxies always start from 0 and timestamp can be
 negative.

Limit timestamp value to 0, because `av_seek_frame()` doesn't accept
negative timestamps and returns with error. This prevents seeking from
working correctly.

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

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 dc39af803e0..1d14f7567c4 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -1140,6 +1140,7 @@ static int ffmpeg_generic_seek_workaround(struct anim *anim, int64_t requested_p
    * small. */
   for (int offset = 5; offset < 25; offset++) {
     current_pos = requested_pos - ((int64_t)(offset)*AV_TIME_BASE / frame_rate);
+    current_pos = max_ii(current_pos, 0);
 
     /* Seek to timestamp. */
     if (av_seek_frame(anim->pFormatCtx, -1, current_pos, AVSEEK_FLAG_BACKWARD) < 0) {



More information about the Bf-blender-cvs mailing list