From dd3d8c7a4ec07b155a64d3b56bf7b0add1bcec77 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Mon, 2 Jan 2017 17:22:43 -0800 Subject: [PATCH] AVIDump: use avformat_free_context This function frees all associated streams and codec contexts, and has existed since libavformat 52.96.0 (February 2011). --- Source/Core/VideoCommon/AVIDump.cpp | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/Source/Core/VideoCommon/AVIDump.cpp b/Source/Core/VideoCommon/AVIDump.cpp index c231e4facb..02e175297c 100644 --- a/Source/Core/VideoCommon/AVIDump.cpp +++ b/Source/Core/VideoCommon/AVIDump.cpp @@ -296,27 +296,10 @@ void AVIDump::Stop() void AVIDump::CloseVideoFile() { - if (s_stream) - { - if (s_stream->codec) - { -#if LIBAVCODEC_VERSION_MAJOR < 55 - avcodec_default_release_buffer(s_stream->codec, s_src_frame); -#endif - avcodec_close(s_stream->codec); - } - av_freep(&s_stream); - } - av_frame_free(&s_src_frame); av_frame_free(&s_scaled_frame); - if (s_format_context) - { - if (s_format_context->pb) - avio_close(s_format_context->pb); - av_freep(&s_format_context); - } + avformat_free_context(s_format_context); if (s_sws_context) {