[Bf-blender-cvs] [376e425c02a] master: Fix T93588: some videos loaded flipped over Y axis on macOS Arm

Brecht Van Lommel noreply at git.blender.org
Tue Jan 11 21:43:36 CET 2022


Commit: 376e425c02ae3ead9137f1a7d019fe3b2f43343e
Author: Brecht Van Lommel
Date:   Tue Jan 11 21:29:02 2022 +0100
Branches: master
https://developer.blender.org/rB376e425c02ae3ead9137f1a7d019fe3b2f43343e

Fix T93588: some videos loaded flipped over Y axis on macOS Arm

Was not actually flipping in the need_aligned_ffmpeg_buffer case.

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

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 1d81653c7cd..6a05b681c88 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -879,7 +879,7 @@ static void ffmpeg_postprocess(struct anim *anim)
             dst2,
             dstStride2);
 #  else
-  /* Scale with swscale then flip image over Y axis. */
+  /* Scale with swscale. */
   int *dstStride = anim->pFrameRGB->linesize;
   uint8_t **dst = anim->pFrameRGB->data;
   const int dstStride2[4] = {dstStride[0], 0, 0, 0};
@@ -896,11 +896,12 @@ static void ffmpeg_postprocess(struct anim *anim)
             dst2,
             dstStride2);
 
-  bottom = (unsigned char *)ibuf->rect;
-  top = bottom + ibuf->x * (ibuf->y - 1) * 4;
+  /* Flip destination image buffer over Y axis. */
+  bottom = (unsigned char *)dst[0];
+  top = bottom + anim->x * (anim->y - 1) * 4;
 
-  h = (ibuf->y + 1) / 2;
-  w = ibuf->x;
+  h = (anim->y + 1) / 2;
+  w = anim->x;
 
   for (y = 0; y < h; y++) {
     unsigned char tmp[4];



More information about the Bf-blender-cvs mailing list