From 8b1041d510dd18fe7d4f4c60856e66e0f4dedff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 31 Jul 2019 15:26:25 +0200 Subject: Fix Visual Studio compatibility in writeffmpeg.c This fixes an incompatibility with Visual Studio 2019 introduced in 631d5026c7bb34320c5d9b60afa5bc44b40fc5e4. It is likely caused by using `# ifdef` inside the use of the `ELEM()` macro. --- source/blender/blenkernel/intern/writeffmpeg.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source/blender/blenkernel/intern/writeffmpeg.c') diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 01a72cbbb9e..203cafb75dd 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -1845,14 +1845,15 @@ void BKE_ffmpeg_codec_settings_verify(RenderData *rd) bool BKE_ffmpeg_alpha_channel_is_supported(RenderData *rd) { int codec = rd->ffcodecdata.codec; - return ELEM(codec, - AV_CODEC_ID_QTRLE, - AV_CODEC_ID_PNG, - AV_CODEC_ID_VP9, + # ifdef FFMPEG_FFV1_ALPHA_SUPPORTED - AV_CODEC_ID_FFV1, + /* Visual Studio 2019 doesn't like #ifdef within ELEM(). */ + if (codec == AV_CODEC_ID_FFV1) { + return true; + } # endif - AV_CODEC_ID_HUFFYUV); + + return ELEM(codec, AV_CODEC_ID_QTRLE, AV_CODEC_ID_PNG, AV_CODEC_ID_VP9, AV_CODEC_ID_HUFFYUV); } void *BKE_ffmpeg_context_create(void) -- cgit v1.2.3