aspect ratio and test card woes
[melted] / src / framework / mlt_frame.c
index 360ecb0..dd89049 100644 (file)
@@ -88,7 +88,7 @@ mlt_properties mlt_frame_properties( mlt_frame this )
 
 int mlt_frame_is_test_card( mlt_frame this )
 {
-       return mlt_properties_get_int( mlt_frame_properties( this ), "test_image" );
+       return mlt_deque_count( this->stack_image ) == 0 || mlt_properties_get_int( mlt_frame_properties( this ), "test_image" );
 }
 
 /** Check if we have a way to derive something than test audio.
@@ -219,13 +219,18 @@ int mlt_frame_get_image( mlt_frame this, uint8_t **buffer, mlt_image_format *for
                if ( test_frame != NULL )
                {
                        mlt_properties test_properties = mlt_frame_properties( test_frame );
-                       mlt_properties_set_double( test_properties, "consumer_aspect_ratio", mlt_properties_get_double( properties, "consumer_aspect_ratio" ) );
+                       //mlt_properties_pass( test_properties, properties, "" );
                        mlt_properties_set( test_properties, "rescale.interp", "nearest" );
+                       //mlt_properties_set( test_properties, "aspect_ratio", "1" );
+                       //mlt_properties_set( test_properties, "consumer_aspect_ratio", "1" );
                        mlt_frame_get_image( test_frame, buffer, format, width, height, writable );
                        mlt_properties_set_data( properties, "test_card_frame", test_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
                        mlt_properties_set_data( properties, "image", *buffer, *width * *height * 2, NULL, NULL );
                        mlt_properties_set_int( properties, "width", *width );
                        mlt_properties_set_int( properties, "height", *height );
+                       //mlt_properties_pass( properties, test_properties, "" );
+                       mlt_properties_set( properties, "rescale.interp", "none" );
+                       mlt_properties_set( properties, "scale", "off" );
                }
                else
                {
@@ -494,6 +499,8 @@ void mlt_resize_yuv422( uint8_t *output, int owidth, int oheight, uint8_t *input
 
        int active_width = 2 * iwidth;
        int inactive_width = out_x_range - in_x_range;
+       uint8_t *p = NULL;
+       uint8_t *end = NULL;
 
        // Loop for the entirety of our output height.
        while ( iheight -- )
@@ -510,8 +517,13 @@ void mlt_resize_yuv422( uint8_t *output, int owidth, int oheight, uint8_t *input
                }
 
                // We're in the input range for this row.
-               memcpy( out_ptr, in_middle + in_line, active_width );
-               out_ptr += active_width;
+               p = in_middle + in_line;
+               end = out_ptr + active_width;
+               while ( out_ptr != end )
+               {
+                       *out_ptr ++ = *p ++;
+                       *out_ptr ++ = *p ++;
+               }
 
                // Fill the outer part with black
                elements = inactive_width;