summaryrefslogtreecommitdiffstats
path: root/common/encode_lavc.c
diff options
context:
space:
mode:
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++) {