From 5f15ca0a1ba5344e46f837e8021acfc7e4a850c3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 22 May 2014 15:07:31 +0100 Subject: [PATCH] Correctly close all codecs, I think. --- src/lib/ffmpeg.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index 017960f2a..ec7ec452e 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -57,14 +57,10 @@ FFmpeg::~FFmpeg () boost::mutex::scoped_lock lm (_mutex); for (uint32_t i = 0; i < _format_context->nb_streams; ++i) { - AVCodecContext* context = _format_context->streams[i]->codec; - if (context->codec_type == AVMEDIA_TYPE_VIDEO || context->codec_type == AVMEDIA_TYPE_AUDIO) { - avcodec_close (context); - } + avcodec_close (_format_context->streams[i]->codec); } av_frame_free (&_frame); - avformat_close_input (&_format_context); } -- 2.30.2