]> git.sesse.net Git - mlt/blobdiff - src/modules/plus/filter_affine.c
remove consumer_aspect_ratio property - use profile instead
[mlt] / src / modules / plus / filter_affine.c
index a21b3d24b3ba9e761cb16e204480b1acc91734ca..d53bdd3cc61cb675039beb8c961681ed8744dca6 100644 (file)
@@ -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 ) );