From ddd068491c9e8f7f77b6bba61269f867bdad204b Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 16 Jul 2017 12:51:48 +0200 Subject: 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. --- common/encode_lavc.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'common/encode_lavc.c') 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++) { -- cgit v1.2.3