From eee312a2d40a44b4f67f2c0debe2936ea91d6f3e Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 12 Nov 2017 17:14:21 -0500 Subject: [PATCH] free contexts --- src/zm_videostore.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/zm_videostore.cpp b/src/zm_videostore.cpp index 40606da13..1c5fab370 100644 --- a/src/zm_videostore.cpp +++ b/src/zm_videostore.cpp @@ -570,6 +570,16 @@ Debug(3, "dts:%d, pts:%d", pkt.dts, pkt.pts ); } #endif } +#if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0) + if ( video_in_ctx ) { + avcodec_free_context(&video_in_ctx); + video_in_ctx = NULL; + } + if ( video_out_ctx ) { + avcodec_free_context(&video_out_ctx); + video_out_ctx = NULL; + } +#endif // When will be not using a file ? // Might someday use this for streaming if ( !(out_format->flags & AVFMT_NOFILE) ) {