]> git.sesse.net Git - mlt/commitdiff
Add force_aspect_ratio to image producers.
authorj-b-m <jb@kdenlive.org>
Tue, 11 Jan 2011 05:05:29 +0000 (21:05 -0800)
committerDan Dennedy <dan@dennedy.org>
Tue, 11 Jan 2011 05:05:29 +0000 (21:05 -0800)
src/modules/gtk2/producer_pixbuf.c
src/modules/qimage/producer_qimage.c

index c99d711e0bcc4708189a4496bd76c2ac6fd0d1ec..3721f097c029f2f5bf1757c13ea49874e5f6c645 100644 (file)
@@ -529,7 +529,12 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
 
                // Set producer-specific frame properties
                mlt_properties_set_int( properties, "progressive", mlt_properties_get_int( producer_properties, "progressive" ) );
-               mlt_properties_set_double( properties, "aspect_ratio", mlt_properties_get_double( producer_properties, "aspect_ratio" ) );
+               
+               double force_ratio = mlt_properties_get_double( producer_properties, "force_aspect_ratio" );
+               if ( force_ratio > 0.0 )
+                       mlt_properties_set_double( properties, "aspect_ratio", force_ratio );
+               else
+                       mlt_properties_set_double( properties, "aspect_ratio", mlt_properties_get_double( producer_properties, "aspect_ratio" ) );
 
                // Push the get_image method
                mlt_frame_push_get_image( *frame, producer_get_image );
index 66d0833395da078b38c4226f0b4a3e844931fa1e..87467dcc095a8de0e7e7f0574924ecfb78af15d0 100644 (file)
@@ -251,7 +251,11 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
 
                // Set producer-specific frame properties
                mlt_properties_set_int( properties, "progressive", mlt_properties_get_int( producer_properties, "progressive" ) );
-               mlt_properties_set_double( properties, "aspect_ratio", mlt_properties_get_double( producer_properties, "aspect_ratio" ) );
+               double force_ratio = mlt_properties_get_double( producer_properties, "force_aspect_ratio" );
+               if ( force_ratio > 0.0 )
+                       mlt_properties_set_double( properties, "aspect_ratio", force_ratio );
+               else
+                       mlt_properties_set_double( properties, "aspect_ratio", mlt_properties_get_double( producer_properties, "aspect_ratio" ) );
 
                // Push the get_image method
                mlt_frame_push_get_image( *frame, producer_get_image );