luma funkiness
[melted] / src / modules / gtk2 / filter_rescale.c
index cf0905e..f061038 100644 (file)
@@ -56,8 +56,22 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
 
        mlt_frame_get_image( this, &input, format, &iwidth, &iheight, 0 );
 
+#if 0
+       // Determine maximum size within the aspect ratio:
+       double i_aspect_ratio = mlt_frame_get_aspect_ratio( this );
+       // TODO: this needs to be provided      q
+       #define o_aspect_ratio ( double )( 4.0 / 3.0 )
+
+       if ( ( owidth * i_aspect_ratio * o_aspect_ratio ) > owidth )
+               oheight *= o_aspect_ratio / i_aspect_ratio;
+       else
+               owidth *= i_aspect_ratio * o_aspect_ratio;
+
+       fprintf( stderr, "rescale: from %dx%d (%f) to %dx%d\n", iwidth, iheight, i_aspect_ratio, owidth, oheight );
+#endif
+       
        // If width and height are correct, don't do anything
-       if ( iwidth != owidth || iheight != oheight )
+       if ( strcmp( interps, "none" ) && input != NULL && ( iwidth != owidth || iheight != oheight ) )
        {
                if ( *format == mlt_image_yuv422 )
                {