diff options
author | Chris Robinson <[email protected]> | 2018-12-19 02:55:21 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-19 02:55:21 -0800 |
commit | fbd47961d54fdc9fa14e9fe9310b578bfbc84e56 (patch) | |
tree | 46bfa7ab328025c3ce7b1a834884a5bc06c3f583 /Alc/alc.cpp | |
parent | e2896dc839e334f62f4975e37a68a3faa9bbdaf8 (diff) |
Don't allow FuMa ordering or normalization above third-order
Diffstat (limited to 'Alc/alc.cpp')
-rw-r--r-- | Alc/alc.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp index 142ee4d2..5de9bd49 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -1734,6 +1734,8 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) return ALC_INVALID_VALUE; if(aorder < 1 || aorder > MAX_AMBI_ORDER) return ALC_INVALID_VALUE; + if((alayout == ALC_FUMA_SOFT || ascale == ALC_FUMA_SOFT) && aorder > 3) + return ALC_INVALID_VALUE; } if((device->Flags&DEVICE_RUNNING)) @@ -3768,8 +3770,18 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName) { if(strcasecmp(fmt, "fuma") == 0) { - device->mAmbiLayout = AmbiLayout::FuMa; - device->mAmbiScale = AmbiNorm::FuMa; + if(device->mAmbiOrder > 3) + ERR("FuMa is incompatible with %d%s order ambisonics (up to third-order only)\n", + device->mAmbiOrder, + (((device->mAmbiOrder%100)/10) == 1) ? "th" : + ((device->mAmbiOrder%10) == 1) ? "st" : + ((device->mAmbiOrder%10) == 2) ? "nd" : + ((device->mAmbiOrder%10) == 3) ? "rd" : "th"); + else + { + device->mAmbiLayout = AmbiLayout::FuMa; + device->mAmbiScale = AmbiNorm::FuMa; + } } else if(strcasecmp(fmt, "acn+sn3d") == 0) { |