summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-05-22 15:07:31 +0100
committerCarl Hetherington <cth@carlh.net>2014-05-22 15:07:31 +0100
commit5f15ca0a1ba5344e46f837e8021acfc7e4a850c3 (patch)
tree9cf9ecf1dee313ac3693d51f140b62d6b9c0292f /src
parenta83e1ca3f9fd1550020054b8e064a8e2048b6410 (diff)
Correctly close all codecs, I think.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ffmpeg.cc6
1 files changed, 1 insertions, 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);
}