aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-19 02:55:21 -0800
committerChris Robinson <[email protected]>2018-12-19 02:55:21 -0800
commitfbd47961d54fdc9fa14e9fe9310b578bfbc84e56 (patch)
tree46bfa7ab328025c3ce7b1a834884a5bc06c3f583 /Alc
parente2896dc839e334f62f4975e37a68a3faa9bbdaf8 (diff)
Don't allow FuMa ordering or normalization above third-order
Diffstat (limited to 'Alc')
-rw-r--r--Alc/alc.cpp16
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)
{