From d49eeb576cbcba966f56aed0dccbdd4694ffbaf7 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 24 Dec 2018 07:33:38 -0800 Subject: Only check ambisonic attributes with B-Format output --- Alc/alc.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Alc/alc.cpp b/Alc/alc.cpp index a5353cb9..ad47e43c 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -1721,19 +1721,22 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) WARN("Missing format for loopback device\n"); return ALC_INVALID_VALUE; } - if(schans == ALC_BFORMAT3D_SOFT && (!alayout || !ascale || !aorder)) - { - WARN("Missing ambisonic info for loopback device\n"); - return ALC_INVALID_VALUE; - } if(!IsValidALCChannels(schans) || !IsValidALCType(stype) || freq < MIN_OUTPUT_RATE) return ALC_INVALID_VALUE; - if(!IsValidAmbiLayout(alayout) || !IsValidAmbiScaling(ascale)) - 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(schans == ALC_BFORMAT3D_SOFT) + { + if(!alayout || !ascale || !aorder) + { + WARN("Missing ambisonic info for loopback device\n"); + return ALC_INVALID_VALUE; + } + if(!IsValidAmbiLayout(alayout) || !IsValidAmbiScaling(ascale)) + 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)) -- cgit v1.2.3