[Bf-blender-cvs] [bec8e436a1c] blender-v2.93-release: Fix: VSE seeking with proxy strips would fail on certain frames

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


Commit: bec8e436a1cd2d5bcb354b984121765560172548
Author: Sebastian Parborg
Date:   Mon Jun 14 19:05:29 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rBbec8e436a1cd2d5bcb354b984121765560172548

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 c63ef14dc02..21d9d739d4e 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