]> git.sesse.net Git - mlt/commitdiff
bug fixes
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 16 Feb 2004 19:17:37 +0000 (19:17 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 16 Feb 2004 19:17:37 +0000 (19:17 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@148 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/core/transition_composite.c
src/modules/gtk2/filter_rescale.c
src/modules/sdl/consumer_sdl.c

index efa251c3ece08c4de6bc85fdf397611a045d9154..0e1c0d76153c5babefaeff041eaf73aa6c9e36c5 100644 (file)
@@ -120,6 +120,12 @@ static int composite_yuv( uint8_t *p_dest, mlt_image_format format_dest, int wid
                int width_b = mlt_properties_get_double( b_props, "real_width" );
                int height_b = mlt_properties_get_double( b_props, "real_height" );
 
+               // Maximise the dimensioning rectangle to the aspect of the b_frame
+               if ( mlt_properties_get_double( b_props, "aspect_ratio" ) * height_src > width_src )
+                       height_src = ( double )width_src / mlt_properties_get_double( b_props, "aspect_ratio" ) + 0.5;
+               else
+                       width_src = mlt_properties_get_double( b_props, "aspect_ratio" ) * height_src + 0.5;
+
                // See if we need to normalise pixel aspect ratio
                // We can use consumer_aspect_ratio because the a_frame will take on this aspect
                double aspect = mlt_properties_get_double( b_props, "consumer_aspect_ratio" );
@@ -133,24 +139,29 @@ static int composite_yuv( uint8_t *p_dest, mlt_image_format format_dest, int wid
 
                        // Normalise pixel aspect
                        if ( iaspect != 0 && iaspect != oaspect )
+                       {
                                width_b = iaspect / oaspect * ( double )width_b + 0.5;
+                               width_src = iaspect / oaspect * ( double )width_src + 0.5;
+                       }
                                
                        // Tell rescale not to normalise display aspect
                        mlt_frame_set_aspect_ratio( that, aspect );
                }
-
-               // Constrain the overlay to the dimensioning rectangle
-               if ( width_b < width_src )
-                       width_src = width_b;
-               if ( height_b < height_src )
-                       height_src = height_b;
-
+               
                // Adjust overall scale for consumer
                double consumer_scale = mlt_properties_get_double( b_props, "consumer_scale" );
                if ( consumer_scale > 0 )
                {
-                       width_src = consumer_scale * width_src + 0.5;
-                       height_src = consumer_scale * height_src + 0.5;
+                       width_b = consumer_scale * width_b + 0.5;
+                       height_b = consumer_scale * height_b + 0.5;
+               }
+
+//             fprintf( stderr, "bounding rect %dx%d for overlay %dx%d\n",     width_src, height_src, width_b, height_b );
+               // Constrain the overlay to the dimensioning rectangle
+               if ( width_b < width_src && height_b < height_src )
+               {
+                       width_src = width_b;
+                       height_src = height_b;
                }
        }
        else if ( mlt_properties_get( b_props, "real_width" ) != NULL )
index 526b58a3dddab60bf1fc6931ec9e03b39f9f0922..39185be4b5bb23b5ba02dd389e6a9448224d68a5 100644 (file)
@@ -175,6 +175,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                        mlt_properties_set_int( properties, "height", oheight );
 
                        // Return the output
+                       *format = mlt_image_yuv422;
                        *width = owidth;
                        *height = oheight;
                        *image = output;
index 9d82aacb8589dbfe2af16424ebcdd5385f5ddd8b..3e5d28e51d13149827952bb952db638ba6b4af8b 100644 (file)
@@ -500,8 +500,8 @@ static void *consumer_thread( void *arg )
                if ( frame != NULL )
                {
                        // SDL adapts display aspect, but set this so pixel aspect can be normalised
-                       mlt_properties_set_double( mlt_frame_properties( frame ), "consumer_aspect_ratio",
-                               mlt_frame_get_aspect_ratio( frame ) );
+//                     mlt_properties_set_double( mlt_frame_properties( frame ), "consumer_aspect_ratio",
+//                             mlt_frame_get_aspect_ratio( frame ) );
                        
                        init_audio = consumer_play_audio( this, frame, init_audio );
                        consumer_play_video( this, frame );