]> git.sesse.net Git - mlt/blobdiff - src/modules/normalize/filter_volume.c
build fixes for FreeBSD
[mlt] / src / modules / normalize / filter_volume.c
index c95a5220b36bd0a6db202ea620bb3d8185b91651..ad503b7f9c3cfa1231e89d8887e8370be67b9eca 100644 (file)
@@ -319,12 +319,6 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
                        // If there is an end adjust gain to the range
                        if ( mlt_properties_get( filter_props, "end" ) != NULL )
                        {
-                               // Determine the time position of this frame in the transition duration
-                               mlt_position in = mlt_filter_get_in( this );
-                               mlt_position out = mlt_filter_get_out( this );
-                               mlt_position time = mlt_frame_get_position( frame );
-                               double position = ( double )( time - in ) / ( double )( out - in + 1 );
-
                                double end = -1;
                                char *p = mlt_properties_get( filter_props, "end" );
                                if ( strcmp( p, "" ) != 0 )
@@ -340,7 +334,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
                                        end = fabs( end );
 
                                if ( end != -1 )
-                                       gain += ( end - gain ) * position;
+                                       gain += ( end - gain ) * mlt_filter_get_progress( this, frame );
                        }
                }
        }
@@ -419,12 +413,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
                // If there is an end adjust gain to the range
                if ( mlt_properties_get( filter_props, "end" ) != NULL )
                {
-                       // Determine the time position of this frame in the transition duration
-                       mlt_position in = mlt_filter_get_in( this );
-                       mlt_position out = mlt_filter_get_out( this );
-                       mlt_position time = mlt_frame_get_position( frame );
-                       double position = ( double )( time - in ) / ( double )( out - in + 1 );
-                       amplitude *= position;
+                       amplitude *= mlt_filter_get_progress( this, frame );
                }
                mlt_properties_set_int( instance_props, "normalise", 1 );
                mlt_properties_set_double( instance_props, "amplitude", amplitude );