summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-07-06 16:12:50 +0200
committerwm4 <wm4@nowhere>2017-07-06 16:25:42 +0200
commitd5702d3b958c967ecac4dec32bff75d723f7ece0 (patch)
treeb6ff2b93b16c12bae9567205f801bd1a75a8eda8 /video/decode
parentaa2bdec26cf2544cffa4b2613086f226127e2ea8 (diff)
downloadmpv-d5702d3b958c967ecac4dec32bff75d723f7ece0.tar.bz2
mpv-d5702d3b958c967ecac4dec32bff75d723f7ece0.tar.xz
ad_lavc, vd_lavc, sd_lavc: consistently use avcodec_free_context()
Instead of various ad-hoc ways to achieve the same thing. (The API was added only later.)
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/vd_lavc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index e02da5ebda..e5de69499d 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -664,11 +664,7 @@ static void uninit_avctx(struct dec_video *vd)
av_frame_free(&ctx->pic);
av_buffer_unref(&ctx->cached_hw_frames_ctx);
- if (ctx->avctx) {
- if (avcodec_close(ctx->avctx) < 0)
- MP_ERR(vd, "Could not close codec.\n");
- av_freep(&ctx->avctx->extradata);
- }
+ avcodec_free_context(&ctx->avctx);
if (ctx->hwdec_dev && ctx->hwdec && ctx->hwdec->generic_hwaccel &&
ctx->hwdec_dev->destroy)