fix(ffmpeg): free memory on close

This commit is contained in:
Adrian Shum 2022-09-11 15:37:25 +08:00 committed by GitHub
parent 2b72572127
commit 01ad70e46c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -88,6 +88,9 @@ func (av *AVContext) ExportImage() ([]byte, error) {
}
func (av *AVContext) Close() {
if av.hasFrame {
C.av_frame_free(&av.frame)
}
freeFormatContext(av)
}