From 058cf29dcce79444cb57da22ae03d9f2abff745e Mon Sep 17 00:00:00 2001 From: Good Guy Date: Mon, 3 Aug 2015 18:25:24 -0600 Subject: [PATCH] repair flickering video encode, bug created last checkin --- cinelerra-5.0/cinelerra/ffmpeg.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cinelerra-5.0/cinelerra/ffmpeg.C b/cinelerra-5.0/cinelerra/ffmpeg.C index a1a2f076..ce3d7044 100644 --- a/cinelerra-5.0/cinelerra/ffmpeg.C +++ b/cinelerra-5.0/cinelerra/ffmpeg.C @@ -626,12 +626,12 @@ int FFVideoStream::decode_frame(AVFrame *frame, int &got_frame) int FFVideoStream::load(VFrame *vframe, int64_t pos) { - if( video_seek(pos) < 0 ) return -1; + int ret = video_seek(pos); + if( ret < 0 ) return -1; if( !frame && !(frame=av_frame_alloc()) ) { fprintf(stderr, "FFVideoStream::load: av_frame_alloc failed\n"); return -1; } - int ret = 0; for( int i=0; ret>=0 && !flushed && curr_pos<=pos && i<1000; ++i ) { ret = read_frame(frame); } @@ -653,7 +653,7 @@ int FFVideoStream::video_seek(int64_t pos) if( gop < 4 ) gop = 4; if( gop > 64 ) gop = 64; if( pos >= curr_pos && pos <= curr_pos + gop ) return 0; - if( pos == curr_pos-1 && curr_pos > seek_pos ) return 0; + if( pos == curr_pos-1 && curr_pos > seek_pos ) return 1; if( !st->codec || !st->codec->codec ) return -1; avcodec_flush_buffers(st->codec); // back up a few frames to read up to current to help repair damages -- 2.26.2