[Bf-blender-cvs] [a67876103a6] master: Fix T101981: Incorrect playback of AVI files

Richard Antalik noreply at git.blender.org
Mon Oct 24 19:46:59 CEST 2022


Commit: a67876103a6bb4554317f09ebd57c1997a45ed89
Author: Richard Antalik
Date:   Mon Oct 24 19:40:39 2022 +0200
Branches: master
https://developer.blender.org/rBa67876103a6bb4554317f09ebd57c1997a45ed89

Fix T101981: Incorrect playback of AVI files

Commit bcc56253e26e introduced 3 frame negative offset for seeking. This
can result in negative seek values.

Ensure, that seek value is always positive.

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

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 71e0d0fe11e..94c0555dcf0 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -1100,7 +1100,12 @@ static int64_t ffmpeg_get_seek_pts(struct anim *anim, int64_t pts_to_search)
    * experimentally. Note: Too big offset can impact performance. Current 3 frame offset has no
    * measurable impact.
    */
-  return pts_to_search - (ffmpeg_steps_per_frame_get(anim) * 3);
+  int64_t seek_pts = pts_to_search - (ffmpeg_steps_per_frame_get(anim) * 3);
+
+  if (seek_pts < 0) {
+    seek_pts = 0;
+  }
+  return seek_pts;
 }
 
 /* This gives us an estimate of which pts our requested frame will have.



More information about the Bf-blender-cvs mailing list