From d97dd6cdd97438de87c97cbfd69599ef99ad3dde Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 4 Apr 2019 14:11:56 -0400 Subject: [PATCH] Should close videostore before closing input codecs/streams. --- src/zm_ffmpeg_camera.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 04b4588d9..c07c9312e 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -675,6 +675,11 @@ int FfmpegCamera::Close() { } #endif + if ( videoStore ) { + delete videoStore; + videoStore = NULL; + } + if ( mVideoCodecContext ) { avcodec_close(mVideoCodecContext); Debug(1,"After codec close"); @@ -700,10 +705,6 @@ int FfmpegCamera::Close() { mFormatContext = NULL; } - if ( videoStore ) { - delete videoStore; - videoStore = NULL; - } if ( packetqueue ) { delete packetqueue; packetqueue = NULL;