- gain = DBFSTOAMP( gain );
-
- // 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 )
- end = fabs( strtod( p, &p) );
-
- while ( isspace( *p ) )
- p++;
-
- /* check if "dB" is given after number */
- if ( strncaseeq( p, "db", 2 ) )
- end = DBFSTOAMP( gain );
-
- if ( end != -1 )
- gain += ( end - gain ) * position;
- }
+ end = DBFSTOAMP( gain );
+ else
+ end = fabs( end );
+
+ if ( end != -1 )
+ gain += ( end - gain ) * mlt_filter_get_progress( this, frame );