X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_frame.c;h=115978dd1cc5103c6c4fa69bd8d26c23a1c0eb01;hb=7651a182bf7191ab5db9b3741caeac2f86540281;hp=2ee3569da342070254fa3037b5e2bd423f5529c2;hpb=490c886cd83df28017ce1b83f5bd49682edaf0bd;p=melted diff --git a/src/framework/mlt_frame.c b/src/framework/mlt_frame.c index 2ee3569..115978d 100644 --- a/src/framework/mlt_frame.c +++ b/src/framework/mlt_frame.c @@ -638,7 +638,7 @@ int mlt_convert_yuv420p_to_yuv422( uint8_t *yuv420p, int width, int height, int return ret; } -uint8_t *mlt_resize_alpha( uint8_t *input, int owidth, int oheight, int iwidth, int iheight ) +uint8_t *mlt_resize_alpha( uint8_t *input, int owidth, int oheight, int iwidth, int iheight, uint8_t alpha_value ) { uint8_t *output = NULL; @@ -650,7 +650,7 @@ uint8_t *mlt_resize_alpha( uint8_t *input, int owidth, int oheight, int iwidth, int iused = iwidth; output = mlt_pool_alloc( owidth * oheight ); - memset( output, 0, owidth * oheight ); + memset( output, alpha_value, owidth * oheight ); offset_x -= offset_x % 2; @@ -741,6 +741,8 @@ uint8_t *mlt_frame_resize_yuv422( mlt_frame this, int owidth, int oheight ) // If width and height are correct, don't do anything if ( iwidth != owidth || iheight != oheight ) { + uint8_t alpha_value = mlt_properties_get_int( properties, "resize_alpha" ); + // Create the output image uint8_t *output = mlt_pool_alloc( owidth * ( oheight + 1 ) * 2 ); @@ -753,7 +755,7 @@ uint8_t *mlt_frame_resize_yuv422( mlt_frame this, int owidth, int oheight ) mlt_properties_set_int( properties, "height", oheight ); // We should resize the alpha too - alpha = mlt_resize_alpha( alpha, owidth, oheight, iwidth, iheight ); + alpha = mlt_resize_alpha( alpha, owidth, oheight, iwidth, iheight, alpha_value ); if ( alpha != NULL ) { mlt_properties_set_data( properties, "alpha", alpha, owidth * oheight, ( mlt_destructor )mlt_pool_release, NULL );