From 8876ee120a9091441c8b2e280920cf6dbe748bca Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sun, 13 Jul 2014 23:06:20 +0200 Subject: [PATCH] Change libav* autodetection to support framedumping on Ubuntu 14.04 Add an "ugly" workaround in the AVIDump code, but looking at other project this seems to be the most common way to handle this API change. --- CMakeTests/CheckLib.cmake | 4 ++-- Source/Core/VideoCommon/AVIDump.cpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeTests/CheckLib.cmake b/CMakeTests/CheckLib.cmake index 7d2a88ccd2..aa8b95b047 100644 --- a/CMakeTests/CheckLib.cmake +++ b/CMakeTests/CheckLib.cmake @@ -55,8 +55,8 @@ endmacro() macro(check_libav) if(PKG_CONFIG_FOUND) - pkg_check_modules(LIBAV libavcodec>=55.52.102 libavformat>=55.33.100 - libswscale>=2.5.102 libavutil>=52.66.100) + pkg_check_modules(LIBAV libavcodec>=54.35.0 libavformat>=54.20.4 + libswscale>=2.1.1 libavutil>=52.3.0) else() message("pkg-config is required to check for libav/ffmpeg") endif() diff --git a/Source/Core/VideoCommon/AVIDump.cpp b/Source/Core/VideoCommon/AVIDump.cpp index 15ffab639a..850868d54e 100644 --- a/Source/Core/VideoCommon/AVIDump.cpp +++ b/Source/Core/VideoCommon/AVIDump.cpp @@ -215,6 +215,11 @@ extern "C" { #include } +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 28, 1) +#define av_frame_alloc avcodec_alloc_frame +#define av_frame_free avcodec_free_frame +#endif + static AVFormatContext* s_format_context = nullptr; static AVStream* s_stream = nullptr; static AVFrame* s_src_frame = nullptr;