From d75391de8ef504a9ec6ec041a52e7822dcdcf55d Mon Sep 17 00:00:00 2001 From: eroen Date: Mon, 24 Jun 2013 21:08:29 +0200 Subject: [PATCH] libav-9 - fix missing includes With libav-9 and ffmpeg-1.0, libavcodec/avcodec.h no longer defines the AV_CH_LAYOUT_* constants. They have been defined in libavutil/channel_layout.h for a long time prior to this. --- apps/openmw/mwrender/videoplayer.cpp | 8 ++++++++ apps/openmw/mwsound/ffmpeg_decoder.hpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/apps/openmw/mwrender/videoplayer.cpp b/apps/openmw/mwrender/videoplayer.cpp index 1b5eddc21b..7e344d1d95 100644 --- a/apps/openmw/mwrender/videoplayer.cpp +++ b/apps/openmw/mwrender/videoplayer.cpp @@ -42,6 +42,14 @@ extern "C" #if AV_VERSION_INT(55, 0, 100) <= AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, LIBAVFORMAT_VERSION_MINOR, LIBAVFORMAT_VERSION_MICRO) #include #endif + + // From libavcodec version 54.0.0 and onward the declaration of + // AV_CH_LAYOUT_* is removed from libavcodec/avcodec.h and moved to + // libavutil/channel_layout.h + #if AV_VERSION_INT(54, 0, 0) <= AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ + LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO) + #include + #endif } #define MAX_AUDIOQ_SIZE (5 * 16 * 1024) diff --git a/apps/openmw/mwsound/ffmpeg_decoder.hpp b/apps/openmw/mwsound/ffmpeg_decoder.hpp index a5e5b5083d..8df6aca674 100644 --- a/apps/openmw/mwsound/ffmpeg_decoder.hpp +++ b/apps/openmw/mwsound/ffmpeg_decoder.hpp @@ -10,6 +10,14 @@ extern "C" { #include #include + +// From libavcodec version 54.0.0 and onward the declaration of +// AV_CH_LAYOUT_* is removed from libavcodec/avcodec.h and moved to +// libavutil/channel_layout.h +#if AV_VERSION_INT(54, 0, 0) <= AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ + LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO) + #include +#endif } #include