[Bf-blender-cvs] [8b1041d510d] master: Fix Visual Studio compatibility in writeffmpeg.c

Sybren A. Stüvel noreply at git.blender.org
Wed Jul 31 15:27:28 CEST 2019


Commit: 8b1041d510dd18fe7d4f4c60856e66e0f4dedff0
Author: Sybren A. Stüvel
Date:   Wed Jul 31 15:26:25 2019 +0200
Branches: master
https://developer.blender.org/rB8b1041d510dd18fe7d4f4c60856e66e0f4dedff0

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.

===================================================================

M	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)



More information about the Bf-blender-cvs mailing list