X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Ffilter_resize.c;fp=src%2Fmodules%2Fcore%2Ffilter_resize.c;h=8ad0210f827d2775f666e8ccb40ebd8e370ddb54;hb=18deadc4f5b3c17c46055d16b78259c561772f29;hp=bd8841b07cc1c5aa610fe16a17178ad009b485de;hpb=b365faec24d3259f01579a628a9c9d300529da23;p=melted diff --git a/src/modules/core/filter_resize.c b/src/modules/core/filter_resize.c index bd8841b..8ad0210 100644 --- a/src/modules/core/filter_resize.c +++ b/src/modules/core/filter_resize.c @@ -75,14 +75,14 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * //fprintf( stderr, "normalised %dx%d output %dx%d %f %f\n", normalised_width, normalised_height, owidth, oheight, ( float )output_ar, ( float )mlt_properties_get_double( properties, "consumer_aspect_ratio" ) * owidth / oheight ); // Optimised for the input_ar > output_ar case (e.g. widescreen on standard) - int scaled_width = input_ar / output_ar * normalised_width + 0.5; + int scaled_width = ( input_ar * normalised_width ) / output_ar + 0.5; int scaled_height = normalised_height; // Now ensure that our images fit in the output frame if ( scaled_width > normalised_width ) { scaled_width = normalised_width; - scaled_height = output_ar / input_ar * normalised_height + 0.5; + scaled_height = ( output_ar * normalised_height ) / input_ar + 0.5; } // Now calculate the actual image size that we want