X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.0%2Fcinelerra%2Fffmpeg.C;fp=cinelerra-5.0%2Fcinelerra%2Fffmpeg.C;h=ce3d704461ffd0b009b27ed187df70880fe2ee57;hb=058cf29dcce79444cb57da22ae03d9f2abff745e;hp=a1a2f0766cb4335dfc32f461f9e74b5a31af83d1;hpb=ea1b87ed83b8920709be62ec6c8235de1c432d63;p=goodguy%2Fhistory.git 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