Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2021-06-07 19:12:57 +0300
committerSebastian Parborg <darkdefende@gmail.com>2021-06-07 19:16:33 +0300
commit1949643ee58c533036395ab2ad4299489460e44b (patch)
treed340fdfc8095d0774fb43507b11e990ebbbc2f78 /source/blender/imbuf
parent7bf9d2c580949a84e95271967710a22e45cce8b3 (diff)
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.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/anim_movie.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index 622b6cbfc16..b65c3e364db 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;