From e10eadfb4e0c3362e3c0ed4e89d0f9eee9eb2475 Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Tue, 6 Aug 2013 20:09:02 -0700 Subject: [PATCH] Fix aspect ratio in resize filter with multi consumer. --- src/framework/mlt_frame.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/framework/mlt_frame.c b/src/framework/mlt_frame.c index 5bd40c4c..c9d7956d 100644 --- a/src/framework/mlt_frame.c +++ b/src/framework/mlt_frame.c @@ -1043,6 +1043,8 @@ mlt_frame mlt_frame_clone( mlt_frame self, int is_deep ) mlt_frame new_frame = mlt_frame_init( NULL ); mlt_properties properties = MLT_FRAME_PROPERTIES( self ); mlt_properties new_props = MLT_FRAME_PROPERTIES( new_frame ); + int width = mlt_properties_get_int( properties, "width" ); + int height = mlt_properties_get_int( properties, "height" ); void *data, *copy; int size; @@ -1054,6 +1056,9 @@ mlt_frame mlt_frame_clone( mlt_frame self, int is_deep ) mlt_properties_set_data( new_props, "movit.convert", mlt_properties_get_data( properties, "movit.convert", NULL), 0, NULL, NULL ); + mlt_properties_set_int( new_props, "meta.media.width", width ); + mlt_properties_set_int( new_props, "meta.media.height", height ); + if ( is_deep ) { data = mlt_properties_get_data( properties, "audio", &size ); @@ -1072,8 +1077,7 @@ mlt_frame mlt_frame_clone( mlt_frame self, int is_deep ) { if ( ! size ) size = mlt_image_format_size( mlt_properties_get_int( properties, "format" ), - mlt_properties_get_int( properties, "width" ), - mlt_properties_get_int( properties, "height" ), NULL ); + width, height, NULL ); copy = mlt_pool_alloc( size ); memcpy( copy, data, size ); mlt_properties_set_data( new_props, "image", copy, size, mlt_pool_release, NULL ); @@ -1082,8 +1086,7 @@ mlt_frame mlt_frame_clone( mlt_frame self, int is_deep ) if ( data ) { if ( ! size ) - size = mlt_properties_get_int( properties, "width" ) * - mlt_properties_get_int( properties, "height" ); + size = width * height; copy = mlt_pool_alloc( size ); memcpy( copy, data, size ); mlt_properties_set_data( new_props, "alpha", copy, size, mlt_pool_release, NULL ); -- 2.39.2