]> git.sesse.net Git - mlt/commitdiff
+ Yet another aspect ratio correction for the filter transition (not 100% correct...
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 19 Aug 2005 12:20:29 +0000 (12:20 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 19 Aug 2005 12:20:29 +0000 (12:20 +0000)
+ Correction for aspect_ratio == 0 case (should honour consumer)

git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@804 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/core/transition_composite.c

index 5fb0eb38c234cd4efe323d083ab7756956c04e43..4cbf324a4e0a4e8bec37947c01af1912068ad1f7 100644 (file)
@@ -732,11 +732,11 @@ static int get_b_frame_image( mlt_transition this, mlt_frame b_frame, uint8_t **
                int normalised_height = geometry->item.h;
                int real_width = get_value( b_props, "real_width", "width" );
                int real_height = get_value( b_props, "real_height", "height" );
-               double input_ar = mlt_properties_get_double( b_props, "consumer_aspect_ratio" );
+               double input_ar = mlt_properties_get_double( b_props, "aspect_ratio" );
                double output_ar = mlt_properties_get_double( b_props, "consumer_aspect_ratio" );
-               int scaled_width = input_ar / output_ar * real_width;
+               int scaled_width = ( input_ar == 0.0 ? output_ar : input_ar ) / output_ar * real_width;
                int scaled_height = real_height;
-                       
+
                // Now ensure that our images fit in the normalised frame
                if ( scaled_width > normalised_width )
                {
@@ -1043,8 +1043,10 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
 
                if ( a_frame == b_frame )
                {
+                       double aspect_ratio = mlt_frame_get_aspect_ratio( b_frame );
                        get_b_frame_image( this, b_frame, &image_b, &width_b, &height_b, &result );
                        alpha_b = mlt_frame_get_alpha_mask( b_frame );
+                       mlt_properties_set_double( a_props, "aspect_ratio", aspect_ratio );
                }
 
                // Get the image from the a frame