]> git.sesse.net Git - mlt/commitdiff
Fix vignette filter position
authorj-b-m <jb@kdenlive.org>
Sat, 23 Jan 2010 00:19:49 +0000 (01:19 +0100)
committerj-b-m <jb@kdenlive.org>
Sat, 23 Jan 2010 00:19:49 +0000 (01:19 +0100)
modified:   src/modules/oldfilm/filter_vignette.c

src/modules/oldfilm/filter_vignette.c

index 319d5446d693baee9ed7dad63ead8f3e6552e93d..f4550d0b2ec842f1c1a80960cba136564b9fa239 100644 (file)
@@ -53,15 +53,12 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
 
        if ( error == 0 && *image )
        {
-               mlt_position in = mlt_filter_get_in( filter );
-               //mlt_position out = mlt_filter_get_out( filter );
-               mlt_position time = mlt_frame_get_position( this );
-               
                float smooth, radius, cx, cy, opac;
-        mlt_position pos = time - in;
-        mlt_properties filter_props = MLT_FILTER_PROPERTIES( filter ) ;
+               mlt_properties filter_props = MLT_FILTER_PROPERTIES( filter ) ;
+               mlt_position pos = mlt_properties_get_position( filter_props, "_pos" );
+
                smooth = geometry_to_float ( mlt_properties_get( filter_props , "smooth" ) , pos ) * 100.0 ;
-        radius = geometry_to_float ( mlt_properties_get( filter_props , "radius" ) , pos ) * *width;
+               radius = geometry_to_float ( mlt_properties_get( filter_props , "radius" ) , pos ) * *width;
                cx = geometry_to_float ( mlt_properties_get( filter_props , "x" ) , pos ) * *width;
                cy = geometry_to_float ( mlt_properties_get( filter_props , "y" ) , pos ) * *height;
                opac = geometry_to_float ( mlt_properties_get( filter_props , "opacity" ) , pos );
@@ -108,6 +105,10 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 {
        
        mlt_frame_push_service( frame, this );
+       
+       // Determine the time position of this frame
+       mlt_properties_set_position( MLT_FILTER_PROPERTIES( this ), "_pos", mlt_frame_get_position( frame ) -  mlt_filter_get_in( this ) );
+       
        mlt_frame_push_get_image( frame, filter_get_image );
        return frame;
 }