}
// Determine the time position of this frame in the transition duration
- mlt_timecode in = mlt_transition_get_in( transition );
- mlt_timecode out = mlt_transition_get_out( transition );
- mlt_timecode time = mlt_frame_get_timecode( b_frame );
- double pos = ( time - in ) / ( out - in );
+ mlt_position in = mlt_transition_get_in( transition );
+ mlt_position out = mlt_transition_get_out( transition );
+ mlt_position time = mlt_frame_get_position( b_frame );
+ double pos = ( (double)time - (double)in ) / ( (double)out - (double)in + 1 );
// Set the b frame properties
mlt_properties_set_double( b_props, "mix", pos );