summaryrefslogtreecommitdiff
path: root/libavcodec/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/options.c')
-rw-r--r--libavcodec/options.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 85c1bec9be..e3ded738bb 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -135,6 +135,21 @@ AVCodecContext *avcodec_alloc_context3(const AVCodec *codec)
return avctx;
}
+void avcodec_free_context(AVCodecContext **pavctx)
+{
+ AVCodecContext *avctx = *pavctx;
+
+ if (!avctx)
+ return;
+
+ avcodec_close(avctx);
+
+ av_freep(&avctx->extradata);
+ av_freep(&avctx->subtitle_header);
+
+ av_freep(pavctx);
+}
+
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
{
const AVCodec *orig_codec = dest->codec;