X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=mlt%2Fsrc%2Fframework%2Fmlt_frame.c;h=3f583d935ddca6b8e8a98cfd080dc0037c655de5;hb=205a3ce6e270b4c478e85f930bfbc5fe28080dda;hp=f8f07870035051b0f7a03b056cdfefc0e6d504d6;hpb=c28f352daacca421f977bca75eefd36a73189dac;p=melted diff --git a/mlt/src/framework/mlt_frame.c b/mlt/src/framework/mlt_frame.c index f8f0787..3f583d9 100644 --- a/mlt/src/framework/mlt_frame.c +++ b/mlt/src/framework/mlt_frame.c @@ -263,16 +263,7 @@ int mlt_frame_get_audio( mlt_frame this, int16_t **buffer, mlt_audio_format *for void mlt_frame_close( mlt_frame this ) { - mlt_frame frame = mlt_frame_pop_frame( this ); - - while ( frame != NULL ) - { - mlt_frame_close( frame); - frame = mlt_frame_pop_frame( this ); - } - mlt_properties_close( &this->parent ); - free( this ); } @@ -465,22 +456,32 @@ int mlt_frame_composite_yuv( mlt_frame this, mlt_frame that, int x, int y, float if ( p_alpha ) p_alpha += x_src + y_src * stride_src / 2; + uint8_t *p = p_src; + uint8_t *q = p_dest; + uint8_t *o = p_dest; + uint8_t *z = p_alpha; + + uint8_t Y; + uint8_t UV; + uint8_t a; + float value; + // now do the compositing only to cropped extents for ( i = 0; i < height_src; i++ ) { - uint8_t *p = p_src; - uint8_t *q = p_dest; - uint8_t *o = p_dest; - uint8_t *z = p_alpha; + p = p_src; + q = p_dest; + o = p_dest; + z = p_alpha; for ( j = 0; j < width_src; j ++ ) { - uint8_t y = *p ++; - uint8_t uv = *p ++; - uint8_t a = ( z == NULL ) ? 255 : *z ++; - float value = ( weight * ( float ) a / 255.0 ); - *o ++ = (uint8_t)( y * value + *q++ * ( 1 - value ) ); - *o ++ = (uint8_t)( uv * value + *q++ * ( 1 - value ) ); + Y = *p ++; + UV = *p ++; + a = ( z == NULL ) ? 255 : *z ++; + value = ( weight * ( float ) a / 255.0 ); + *o ++ = (uint8_t)( Y * value + *q++ * ( 1 - value ) ); + *o ++ = (uint8_t)( UV * value + *q++ * ( 1 - value ) ); } p_src += stride_src;