[Bf-blender-cvs] [02a6be54432] blender-v2.93-release: Fix: Wrong logic for checking if we can reuse decoded frame

Sebastian Parborg noreply at git.blender.org
Wed Jun 30 09:47:15 CEST 2021


Commit: 02a6be544324d6d42e2bbf2c8dca89169961ce2d
Author: Sebastian Parborg
Date:   Mon Jun 7 18:12:57 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rB02a6be544324d6d42e2bbf2c8dca89169961ce2d

Fix: Wrong logic for checking if we can reuse decoded frame

We should only check if the new pts value lies inside the duration of
the current frame.

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

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 4b5da22227b..21c7df277dd 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -1076,7 +1076,8 @@ static int64_t ffmpeg_get_pts_to_search(struct anim *anim,
 static bool ffmpeg_pts_matches_last_frame(struct anim *anim, int64_t pts_to_search)
 {
   if (anim->pFrame && anim->cur_frame_final) {
-    return labs(anim->cur_pts - pts_to_search) < anim->pFrame->pkt_duration;
+    int64_t diff = pts_to_search - anim->cur_pts;
+    return diff >= 0 && diff < anim->pFrame->pkt_duration;
   }
 
   return false;



More information about the Bf-blender-cvs mailing list