X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.0%2Fcinelerra%2Fffmpeg.C;h=694f18343433d0a4118ac6c3e7f725a7ae157a94;hb=a191ee43586c4563e15fb3ab4c7594be3e81fa3b;hp=af0c5486f100adb86880e40b4093a4f9cb5a5298;hpb=48375f1b11fa903519ef677c1f118510635c0a3b;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.0/cinelerra/ffmpeg.C b/cinelerra-5.0/cinelerra/ffmpeg.C index af0c5486..694f1834 100644 --- a/cinelerra-5.0/cinelerra/ffmpeg.C +++ b/cinelerra-5.0/cinelerra/ffmpeg.C @@ -548,6 +548,7 @@ int FFAudioStream::audio_seek(int64_t pos) return 0; } if( pos == curr_pos ) return 0; + if( !st->codec || !st->codec->codec ) return -1; avcodec_flush_buffers(st->codec); double secs = (double)pos / sample_rate; int64_t tstmp = secs * st->time_base.den / st->time_base.num; @@ -646,6 +647,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( !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 if( (pos-=gop) < 0 ) pos = 0;