camera: Add padding to bytesused calculation (MR 13)

This commit is contained in:
Yassine Oudjana
2022-02-24 13:10:25 +04:00
committed by Martijn Braam
parent ba57d91da4
commit 5f65d910f5

View File

@@ -554,8 +554,9 @@ mp_camera_capture_buffer(MPCamera *camera, MPBuffer *buffer)
bytesused = buf.bytesused; bytesused = buf.bytesused;
} }
assert(bytesused == assert(bytesused == (mp_pixel_format_width_to_bytes(pixel_format, width) +
mp_pixel_format_width_to_bytes(pixel_format, width) * height); mp_pixel_format_width_to_padding(pixel_format, width)) *
height);
assert(bytesused == camera->buffers[buf.index].length); assert(bytesused == camera->buffers[buf.index].length);
buffer->index = buf.index; buffer->index = buf.index;