fix(ffmpeg): no codec handling

This commit is contained in:
Adrian Shum 2022-10-13 20:56:43 +08:00 committed by GitHub
parent 17b50dea3c
commit 66b74a271f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 0 deletions

View file

@ -85,6 +85,9 @@ func LoadAVContext(ctx context.Context, reader io.Reader, size int64) (*AVContex
}
func (av *AVContext) ProcessFrames(maxFrames int) (err error) {
if av.formatContext == nil || av.codecContext == nil {
return ErrDecoderNotFound
}
if av.thumbContext == nil {
return createThumbContext(av, C.int(maxFrames))
}