[Bf-blender-cvs] [ecba8c12430] master: Fix mistake in seeking cleanup

Richard Antalik noreply at git.blender.org
Wed Mar 2 22:32:14 CET 2022


Commit: ecba8c1243045e72c92f4575393821fc6bf2665f
Author: Richard Antalik
Date:   Wed Mar 2 22:25:43 2022 +0100
Branches: master
https://developer.blender.org/rBecba8c1243045e72c92f4575393821fc6bf2665f

Fix mistake in seeking cleanup

In `ffmpeg_read_video_frame` fix assignment used as truth value.
In `ffmpeg_seek_recover_stream_position` loop while return value is
greater or equal to 0.

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

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 f97a50ecf47..7cde49f44b7 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -870,11 +870,12 @@ static void ffmpeg_decode_store_frame_pts(struct anim *anim)
 static int ffmpeg_read_video_frame(struct anim *anim, AVPacket *packet)
 {
   int ret = 0;
-  while (ret = av_read_frame(anim->pFormatCtx, packet) >= 0) {
+  while ((ret = av_read_frame(anim->pFormatCtx, packet)) >= 0) {
     if (packet->stream_index == anim->videoStream) {
       break;
     }
   }
+
   return ret;
 }
 
@@ -1174,7 +1175,7 @@ static int ffmpeg_generic_seek_workaround(struct anim *anim,
 static void ffmpeg_seek_recover_stream_position(struct anim *anim)
 {
   AVPacket *temp_packet = av_packet_alloc();
-  while (ffmpeg_read_video_frame(anim, temp_packet)) {
+  while (ffmpeg_read_video_frame(anim, temp_packet) >= 0) {
     int64_t current_pts = timestamp_from_pts_or_dts(anim->cur_packet->pts, anim->cur_packet->dts);
     int64_t temp_pts = timestamp_from_pts_or_dts(temp_packet->pts, temp_packet->dts);
     av_packet_unref(temp_packet);



More information about the Bf-blender-cvs mailing list