]> git.sesse.net Git - mlt/blobdiff - src/modules/frei0r/producer_frei0r.c
Work around for vid.stab chroma skew when using 4:2:2
[mlt] / src / modules / frei0r / producer_frei0r.c
index 26259f329c8ceed236e82b2f6b38f9ed5d62cca0..7e24be456582b3ad20bc8cba8489cdd9b693511d 100644 (file)
@@ -36,6 +36,12 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        // Obtain properties of producer
        mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer );
 
+       // Choose suitable out values if nothing specific requested
+       if ( *width <= 0 )
+               *width = mlt_service_profile( MLT_PRODUCER_SERVICE(producer) )->width;
+       if ( *height <= 0 )
+               *height = mlt_service_profile( MLT_PRODUCER_SERVICE(producer) )->height;
+
        // Allocate the image
        int size = *width * ( *height + 1 ) * 4;
 
@@ -78,7 +84,8 @@ int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int index )
 
                // Set producer-specific frame properties
                mlt_properties_set_int( properties, "progressive", 1 );
-               mlt_properties_set_double( properties, "aspect_ratio", mlt_properties_get_double( producer_props, "aspect_ratio" ) );
+               mlt_profile profile = mlt_service_profile( MLT_PRODUCER_SERVICE( producer ) );
+               mlt_properties_set_double( properties, "aspect_ratio", mlt_profile_sar( profile ) );
 
                // Push the get_image method
                mlt_frame_push_get_image( *frame, producer_get_image );