]> git.sesse.net Git - mlt/commitdiff
fix a/v sync after recent change for faster AVCHD seeking
authorDan Dennedy <dan@dennedy.org>
Fri, 1 Jun 2012 18:15:08 +0000 (11:15 -0700)
committerDan Dennedy <dan@dennedy.org>
Fri, 1 Jun 2012 19:03:47 +0000 (12:03 -0700)
src/modules/avformat/producer_avformat.c

index 455de31c9dbd7a840364fd5425d613ff0e1cd92d..a8dd5ebd8c753811e23cf5ae9d11c52af1117c1d 100644 (file)
@@ -1085,6 +1085,8 @@ static int seek_video( producer_avformat self, mlt_position position,
                                        timestamp += self->first_pts;
                                else if ( context->start_time != AV_NOPTS_VALUE )
                                        timestamp += context->start_time;
+                               if ( req_position <= 0 )
+                                       timestamp = 0;
                        }
                        else
                        {
@@ -1501,9 +1503,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
 
        // Duplicate the last image if necessary
        if ( self->av_frame && self->av_frame->linesize[0]
-                && ( paused
-                         || self->current_position == req_position
-                         || ( !use_new_seek && self->current_position > req_position ) ) )
+                && ( paused || self->current_position >= req_position ) )
        {
                // Duplicate it
                if ( ( image_size = allocate_buffer( frame, codec_context, buffer, format, width, height ) ) )