Some clip formats give a slightly longer duration estimate, and MLT does
not handle that well especially in some non-interactive use cases like
transcoding and automated processing.
if ( context->duration != AV_NOPTS_VALUE )
{
// This isn't going to be accurate for all formats
- mlt_position frames = ( mlt_position )( ( ( double )context->duration / ( double )AV_TIME_BASE ) * fps );
+ mlt_position frames = ( mlt_position )( ( ( double )context->duration / ( double )AV_TIME_BASE ) * fps - 1 );
mlt_properties_set_position( properties, "out", frames - 1 );
mlt_properties_set_position( properties, "length", frames );
}