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.
This commit is contained in:
Sebastian Parborg 2021-06-07 18:12:57 +02:00 committed by Jeroen Bakker
parent 7eb3e77b94
commit 02a6be5443
Notes: blender-bot 2023-02-13 14:30:30 +01:00
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
1 changed files with 2 additions and 1 deletions

View File

@ -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;