From 3e71220efcc11afaedb33a1cb2c9d3cd2cb50228 Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Mon, 7 Nov 2022 17:44:14 +0100 Subject: Fix support for building with ffmpeg < 5.0 Seems like the new audio channel api was not as backwards compatible as we thought. Therefore we need to reintroduce the usage of the old api to make older ffmpeg version be able to compile Blender. This change is only intended to stick around for two releases or so. After that we hope that most Linux distros ship ffmpeg >=5.0 so we can switch to it. Reviewed By: Sergey Differential Revision: http://developer.blender.org/D16408 --- intern/ffmpeg/ffmpeg_compat.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'intern/ffmpeg/ffmpeg_compat.h') diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h index f311e04d8e0..f7d87af8bca 100644 --- a/intern/ffmpeg/ffmpeg_compat.h +++ b/intern/ffmpeg/ffmpeg_compat.h @@ -36,6 +36,14 @@ # define FFMPEG_INLINE static inline #endif +#if (LIBAVFORMAT_VERSION_MAJOR < 59) +/* For versions older than ffmpeg 5.0, use the old channel layout variables. + * We intend to only keep this workaround for around two releases (3.5, 3.6). + * If it sticks around any longer, then we should consider refactoring this. + */ +# define FFMPEG_USE_OLD_CHANNEL_VARS +#endif + #if (LIBAVFORMAT_VERSION_MAJOR < 58) || \ ((LIBAVFORMAT_VERSION_MAJOR == 58) && (LIBAVFORMAT_VERSION_MINOR < 76)) # define FFMPEG_USE_DURATION_WORKAROUND 1 -- cgit v1.2.3