summaryrefslogtreecommitdiffstats
path: root/audio/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 /audio/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 'audio/decode')
-rw-r--r--audio/decode/ad_lavc.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c
index 6f28d062ee..d701630fc6 100644
--- a/audio/decode/ad_lavc.c
+++ b/audio/decode/ad_lavc.c
@@ -147,14 +147,8 @@ static void uninit(struct dec_audio *da)
struct priv *ctx = da->priv;
if (!ctx)
return;
- AVCodecContext *lavc_context = ctx->avctx;
- if (lavc_context) {
- if (avcodec_close(lavc_context) < 0)
- MP_ERR(da, "Could not close codec.\n");
- av_freep(&lavc_context->extradata);
- av_freep(&lavc_context);
- }
+ avcodec_free_context(&ctx->avctx);
av_frame_free(&ctx->avframe);
}