]> git.sesse.net Git - mlt/commitdiff
fix seeking on some formats (HDV) after a/v sync improvements
authorDan Dennedy <dan@dennedy.org>
Sat, 25 Aug 2012 19:42:27 +0000 (12:42 -0700)
committerDan Dennedy <dan@dennedy.org>
Sat, 25 Aug 2012 19:42:27 +0000 (12:42 -0700)
src/modules/avformat/producer_avformat.c

index 245cf056f8eeb4c43f2c2a800d5282e9beec7791..eeab67e4081e9e1b33c99de2c31df8e18b05fcab 100644 (file)
@@ -1059,13 +1059,13 @@ static int seek_video( producer_avformat self, mlt_position position,
                if ( self->last_position == POSITION_INITIAL )
                {
                        int ret = 0;
-                       int toscan = 100;
+                       int toscan = 500;
                        AVPacket pkt;
 
                        while ( ret >= 0 && toscan-- > 0 )
                        {
                                ret = av_read_frame( context, &pkt );
-                               if ( ret >= 0 && pkt.stream_index == self->video_index )
+                               if ( ret >= 0 && pkt.stream_index == self->video_index && ( pkt.flags & PKT_FLAG_KEY ) )
                                {
                                        mlt_log_debug( MLT_PRODUCER_SERVICE(producer),
                                                "first_pts %"PRId64" dts %"PRId64" pts_dts_delta %d\n",