slightly better seeking in drop frame cases
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 30 May 2004 23:04:07 +0000 (23:04 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 30 May 2004 23:04:07 +0000 (23:04 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@320 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/avformat/producer_avformat.c

index b936ff3..1a5e2ee 100644 (file)
@@ -418,7 +418,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                        // Fast forward - seeking is inefficient for small distances - just ignore following frames
                        ignore = position - expected;
                }
-               else
+               else if ( position < expected || position - expected >= 12 )
                {
                        // Set to the real timecode
                        av_seek_frame( context, -1, mlt_properties_get_double( properties, "start_time" ) + real_timecode * 1000000.0 );
@@ -765,7 +765,7 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
                        // Fast forward - seeking is inefficient for small distances - just ignore following frames
                        ignore = position - expected;
                }
-               else
+               else if ( position < expected || position - expected >= 12 )
                {
                        // Set to the real timecode
                        if ( av_seek_frame( context, -1, mlt_properties_get_double( properties, "start_time" ) + real_timecode * 1000000.0 ) != 0 )