diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-07-31 16:26:25 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2019-07-31 16:26:29 +0300 |
commit | 8b1041d510dd18fe7d4f4c60856e66e0f4dedff0 (patch) | |
tree | 434e8b0f8850c03083bbef342dac8b1f8f322ad8 | |
parent | 64e029ea92071870b5004baaf6401fcf4b370fd8 (diff) |
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.
-rw-r--r-- | source/blender/blenkernel/intern/writeffmpeg.c | 13 |
1 files changed, 7 insertions, 6 deletions
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) |