]> git.sesse.net Git - mlt/blobdiff - src/modules/core/producer_consumer.c
Massive refactoring of image conversion.
[mlt] / src / modules / core / producer_consumer.c
index 9f4992cb2515c75d99c317fee9af79ad2d33d960..4baa186f39e814cb5185e025d21f58a3e4566ca4 100644 (file)
@@ -46,7 +46,8 @@ static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format
        int result = mlt_frame_get_image( nested_frame, image, format, width, height, writable );
 
        // Allocate the image
-       int size = *width * *height * ( *format == mlt_image_yuv422 ? 2 : *format == mlt_image_rgb24 ? 3 : *format == mlt_image_rgb24a ? 4 : ( 3 / 2 ) );
+       int size = *width * *height * ( *format == mlt_image_yuv422 ? 2 : *format == mlt_image_rgb24 ? 3 :
+               ( *format == mlt_image_rgb24a || *format == mlt_image_opengl ) ? 4 : ( 3 / 2 ) );
        uint8_t *new_image = mlt_pool_alloc( size );
 
        // Update the frame