]> git.sesse.net Git - mlt/commitdiff
Be pessimistic about the duration (kdenlive-1962).
authorDan Dennedy <dan@dennedy.org>
Sun, 30 Jan 2011 19:57:05 +0000 (11:57 -0800)
committerDan Dennedy <dan@dennedy.org>
Sun, 30 Jan 2011 19:57:05 +0000 (11:57 -0800)
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.

src/modules/avformat/producer_avformat.c

index b21d77270f00cac888cf9a92ef379bb58ad73408..6658e86a8bd131cbc25f8eda8218aedab69f1e28 100644 (file)
@@ -586,7 +586,7 @@ static int producer_open( producer_avformat this, mlt_profile profile, char *fil
                        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 );
                        }