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 )
{
// Honour the fill request - this will scale the image to fill width or height while maintaining a/r
// ????: Shouln't this be the default behaviour?
- if ( mlt_properties_get_int( properties, "fill" ) )
+ if ( mlt_properties_get_int( properties, "fill" ) && scaled_width > 0 && scaled_height > 0 )
{
if ( scaled_height < normalised_height && scaled_width * normalised_height / scaled_height < normalised_width )
{
// Since we are the consumer of the b_frame, we must pass along these
// consumer properties from the a_frame
mlt_properties_set_double( b_props, "consumer_deinterlace", mlt_properties_get_double( a_props, "consumer_deinterlace" ) );
+ mlt_properties_set( b_props, "consumer_deinterlace_method", mlt_properties_get( a_props, "consumer_deinterlace_method" ) );
mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
// TODO: Dangerous/temporary optimisation - if nothing to do, then do nothing
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