From 83018fd07d3ef9881a7feafbefb29e417035a7d7 Mon Sep 17 00:00:00 2001 From: j-b-m Date: Sat, 30 Jun 2007 16:39:57 +0000 Subject: [PATCH] Better fix for aspect_ratio problem in framebuffer producer git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1000 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/kdenlive/producer_framebuffer.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/kdenlive/producer_framebuffer.c b/src/modules/kdenlive/producer_framebuffer.c index 03ed6b3..9e6ba2d 100644 --- a/src/modules/kdenlive/producer_framebuffer.c +++ b/src/modules/kdenlive/producer_framebuffer.c @@ -164,6 +164,8 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index // Get the frame mlt_service_get_frame( MLT_PRODUCER_SERVICE( real_producer ), &first_frame, index ); + + double ratio = (double) mlt_properties_get_int( MLT_FRAME_PROPERTIES( first_frame ), "width" ) / (double) mlt_properties_get_int( MLT_FRAME_PROPERTIES( first_frame ), "height" ) / ( (double) mlt_properties_get_int(MLT_FRAME_PROPERTIES( *frame ), "width" ) / (double) mlt_properties_get_int( MLT_FRAME_PROPERTIES( *frame ), "height" )); } // Make sure things are in their place @@ -176,11 +178,10 @@ 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); + mlt_properties_set_double( MLT_FRAME_PROPERTIES(*frame), "aspect_ratio", mlt_properties_get_double( properties, "ratio_fix" )); } return 0; -- 1.7.4.4