From d3afe652fec9d34ec19ea5c93458ef45baaf6b85 Mon Sep 17 00:00:00 2001 From: j-b-m Date: Sat, 30 Jun 2007 16:17:23 +0000 Subject: [PATCH] Fix aspect ratio for slowmotion / freeze effect git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@999 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/kdenlive/producer_framebuffer.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/modules/kdenlive/producer_framebuffer.c b/src/modules/kdenlive/producer_framebuffer.c index d58f8a0..03ed6b3 100644 --- a/src/modules/kdenlive/producer_framebuffer.c +++ b/src/modules/kdenlive/producer_framebuffer.c @@ -166,7 +166,6 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index mlt_service_get_frame( MLT_PRODUCER_SERVICE( real_producer ), &first_frame, index ); } - // Make sure things are in their place mlt_properties_set_data( properties, "first_frame", first_frame, 0, NULL, NULL ); @@ -177,9 +176,11 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index mlt_frame_push_service( *frame, this ); mlt_frame_push_service( *frame, framebuffer_get_image ); + double ratio = (double) mlt_properties_get_int(properties, "width" ) / (double) mlt_properties_get_int( properties, "height" ) / ( (double) mlt_properties_get_int( MLT_FRAME_PROPERTIES( first_frame ), "width" ) / (double) mlt_properties_get_int( MLT_FRAME_PROPERTIES( first_frame ), "height" ) ); + // Give the returned frame temporal identity mlt_frame_set_position( *frame, mlt_producer_position( this ) ); - + mlt_properties_set_double( MLT_FRAME_PROPERTIES(*frame), "aspect_ratio", mlt_properties_get_double(MLT_PRODUCER_PROPERTIES( real_producer), "aspect_ratio" ) * ratio); } return 0; @@ -220,7 +221,7 @@ mlt_producer producer_framebuffer_init( char *arg ) count = strcspn( ptr, ":" ); ptr[count] = '\0'; - real_producer = mlt_factory_producer( "fezzik", props ); + real_producer = mlt_factory_producer( "fezzik", props ); ptr += count + 1; ptr += strspn( ptr, ":" ); @@ -243,9 +244,9 @@ mlt_producer producer_framebuffer_init( char *arg ) // Store the producer and fitler mlt_properties_set_data( properties, "producer", real_producer, 0, ( mlt_destructor )mlt_producer_close, NULL ); - // Grap some stuff from the real_producer - mlt_properties_pass_list( properties, MLT_PRODUCER_PROPERTIES( real_producer ), - "length,resource,width,height" ); + // Grab some stuff from the real_producer + mlt_properties_pass_list( properties, MLT_PRODUCER_PROPERTIES( real_producer ), "length,resource,width,height" ); + if ( speed != 1.0 ) { -- 1.7.4.4