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

Was not actually flipping in the need_aligned_ffmpeg_buffer case.
This commit is contained in:
Brecht Van Lommel 2022-01-11 21:29:02 +01:00
parent 45bb6b836a
commit 376e425c02
Notes: blender-bot 2023-02-14 11:01:33 +01:00
Referenced by issue #93588, Imported video is wrong orientation on Mac OS Arm.
1 changed files with 6 additions and 5 deletions

View File

@ -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];