X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmodules%2Fplus%2Ffilter_affine.c;h=d53bdd3cc61cb675039beb8c961681ed8744dca6;hb=0d93886ee9b1e0e4d722ee2e0fc0defc2e6699c9;hp=a21b3d24b3ba9e761cb16e204480b1acc91734ca;hpb=589c1b3fc635b5c7fb28c4c7d9f12054bd5b4b25;p=mlt diff --git a/src/modules/plus/filter_affine.c b/src/modules/plus/filter_affine.c index a21b3d24..d53bdd3c 100644 --- a/src/modules/plus/filter_affine.c +++ b/src/modules/plus/filter_affine.c @@ -48,18 +48,17 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * mlt_producer producer = mlt_properties_get_data( properties, "producer", NULL ); mlt_transition transition = mlt_properties_get_data( properties, "transition", NULL ); mlt_frame a_frame = NULL; + mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( filter ) ); if ( producer == NULL ) { char *background = mlt_properties_get( properties, "background" ); - mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( filter ) ); producer = mlt_factory_producer( profile, NULL, background ); mlt_properties_set_data( properties, "producer", producer, 0, (mlt_destructor)mlt_producer_close, NULL ); } if ( transition == NULL ) { - mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( filter ) ); transition = mlt_factory_transition( profile, "affine", NULL ); mlt_properties_set_data( properties, "transition", transition, 0, (mlt_destructor)mlt_transition_close, NULL ); } @@ -70,7 +69,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * mlt_properties frame_properties = MLT_FRAME_PROPERTIES( this ); mlt_position in = mlt_filter_get_in( filter ); mlt_position out = mlt_filter_get_out( filter ); - double consumer_ar = mlt_properties_get_double( frame_properties, "consumer_aspect_ratio" ); + double consumer_ar = mlt_profile_sar( profile ); mlt_transition_set_in_and_out( transition, in, out ); if ( out > 0 ) { mlt_properties_set_position( MLT_PRODUCER_PROPERTIES( producer ), "length", out - in + 1 ); @@ -85,11 +84,10 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * // mlt_properties_set_int( MLT_FRAME_PROPERTIES( a_frame ), "distort", 1 ); // Special case - aspect_ratio = 0 - if ( mlt_properties_get_double( frame_properties, "aspect_ratio" ) == 0 ) - mlt_properties_set_double( frame_properties, "aspect_ratio", consumer_ar ); - if ( mlt_properties_get_double( MLT_FRAME_PROPERTIES( a_frame ), "aspect_ratio" ) == 0 ) - mlt_properties_set_double( MLT_FRAME_PROPERTIES( a_frame ), "aspect_ratio", consumer_ar ); - mlt_properties_set_double( MLT_FRAME_PROPERTIES( a_frame ), "consumer_aspect_ratio", consumer_ar ); + if ( mlt_frame_get_aspect_ratio( this ) == 0 ) + mlt_frame_set_aspect_ratio( this, consumer_ar ); + if ( mlt_frame_get_aspect_ratio( a_frame ) == 0 ) + mlt_frame_set_aspect_ratio( a_frame, consumer_ar ); // Add the affine transition onto the frame stack mlt_service_unlock( MLT_FILTER_SERVICE( filter ) );