summaryrefslogtreecommitdiffstats
path: root/common/encode_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-07-16 12:51:48 +0200
committerwm4 <wm4@nowhere>2017-07-16 12:51:48 +0200
commitddd068491c9e8f7f77b6bba61269f867bdad204b (patch)
tree579de2a6443a52df12b1b4f813a5466eea7b7c74 /common/encode_lavc.c
parent8e20ef4292719233d4b249ab714433e845cf6da2 (diff)
downloadmpv-ddd068491c9e8f7f77b6bba61269f867bdad204b.tar.bz2
mpv-ddd068491c9e8f7f77b6bba61269f867bdad204b.tar.xz
Replace remaining avcodec_close() calls
This API isn't deprecated (yet?), but it's still inferior and harder to use than avcodec_free_context(). Leave the call only in 1 case in af_lavcac3enc.c, where we apparently seriously close and reopen the encoder for whatever reason.
Diffstat (limited to 'common/encode_lavc.c')
-rw-r--r--common/encode_lavc.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/common/encode_lavc.c b/common/encode_lavc.c
index 2ae9eef6bd..dca8f8b0e7 100644
--- a/common/encode_lavc.c
+++ b/common/encode_lavc.c
@@ -384,10 +384,7 @@ void encode_lavc_finish(struct encode_lavc_context *ctx)
stream_write_buffer(ctx->twopass_bytebuffer_v,
stats, strlen(stats));
}
- avcodec_close(ctx->vcc);
- talloc_free(ctx->vcc->stats_in);
- av_free(ctx->vcc);
- ctx->vcc = NULL;
+ avcodec_free_context(&ctx->vcc);
}
if (ctx->acc) {
@@ -397,10 +394,7 @@ void encode_lavc_finish(struct encode_lavc_context *ctx)
stream_write_buffer(ctx->twopass_bytebuffer_a,
stats, strlen(stats));
}
- avcodec_close(ctx->acc);
- talloc_free(ctx->acc->stats_in);
- av_free(ctx->acc);
- ctx->acc = NULL;
+ avcodec_free_context(&ctx->acc);
}
for (i = 0; i < ctx->avc->nb_streams; i++) {