deps/media-playback: Use avcodec_free_context when possible
A bit better handling that should prevent any possible memory leakage due to any internal data allocated by FFmpeg.
This commit is contained in:
parent
ba75dd6a70
commit
548f3fa9a9
5
deps/media-playback/media-playback/decode.c
vendored
5
deps/media-playback/media-playback/decode.c
vendored
@ -167,9 +167,10 @@ void mp_decode_free(struct mp_decode *d)
|
||||
circlebuf_free(&d->packets);
|
||||
|
||||
if (d->decoder) {
|
||||
avcodec_close(d->decoder);
|
||||
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 40, 101)
|
||||
av_free(d->decoder);
|
||||
avcodec_free_context(&d->decoder);
|
||||
#else
|
||||
avcodec_close(d->decoder);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user