- mlt_position frames = ( mlt_position )( ( ( double )format->duration / ( double )AV_TIME_BASE ) * fps );
+ // We will treat everything with the producer fps.
+ mlt_position frames = ( mlt_position )( int )( format->duration *
+ profile->frame_rate_num / profile->frame_rate_den / AV_TIME_BASE);
mlt_properties_set_position( properties, "out", frames - 1 );
mlt_properties_set_position( properties, "length", frames );
mlt_properties_set_int( properties, "_length_computed", 1 );
mlt_properties_set_position( properties, "out", frames - 1 );
mlt_properties_set_position( properties, "length", frames );
mlt_properties_set_int( properties, "_length_computed", 1 );