[Bf-blender-cvs] [2e5671a9591] master: Fix: VSE seeking with proxy strips would fail on certain frames

Sebastian Parborg noreply at git.blender.org
Mon Jun 14 19:08:56 CEST 2021


Commit: 2e5671a959182dadcdd55117732082ab7893f3d1
Author: Sebastian Parborg
Date:   Mon Jun 14 19:05:29 2021 +0200
Branches: master
https://developer.blender.org/rB2e5671a959182dadcdd55117732082ab7893f3d1

Fix: VSE seeking with proxy strips would fail on certain frames

If the last decoded frame had the same timestamp as the GOP current
packet, then we would skip over this frame when fast forwarding and we
would seek until the end of the file.

This would could only be triggered reliably in single threaded mode.

Reviewed By: Richard Antalik

Differential Revision: http://developer.blender.org/D11601

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

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 796f7469fb3..450c76630a8 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -1290,11 +1290,16 @@ static int ffmpeg_seek_to_key_frame(struct anim *anim,
 
       if (same_gop && position > anim->cur_position) {
         /* Change back to our old frame position so we can simply continue decoding from there. */
+        int64_t cur_pts = timestamp_from_pts_or_dts(anim->cur_packet->pts, anim->cur_packet->dts);
+
+        if (cur_pts == gop_pts) {
+          /* We are already at the correct position. */
+          return 0;
+        }
         AVPacket *temp = av_packet_alloc();
+
         while (av_read_frame(anim->pFormatCtx, temp) >= 0) {
           int64_t temp_pts = timestamp_from_pts_or_dts(temp->pts, temp->dts);
-          int64_t cur_pts = timestamp_from_pts_or_dts(anim->cur_packet->pts,
-                                                      anim->cur_packet->dts);
           if (temp->stream_index == anim->videoStream && temp_pts == cur_pts) {
             break;
           }



More information about the Bf-blender-cvs mailing list