// 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;
// 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 );