From a6f6533a28fd68c4e552353235b9a2a7aeffa0cd Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 11 May 2017 11:04:25 -0700 Subject: Update ALC_OUTPUT_LIMITER_SOFT to handle ALC_DONT_CARE_SOFT Essentially just adding a comment about it. Since we default to on, the behavior already fit. --- Alc/ALc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Alc/ALc.c b/Alc/ALc.c index fe8a0266..55292480 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -1762,7 +1762,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) { enum HrtfRequestMode hrtf_userreq = Hrtf_Default; enum HrtfRequestMode hrtf_appreq = Hrtf_Default; - ALCenum gainLimiter = !!device->Limiter; + ALCenum gainLimiter = device->Limiter ? ALC_TRUE : ALC_FALSE; const ALsizei old_sends = device->NumAuxSends; ALsizei new_sends = device->NumAuxSends; enum DevFmtChannels oldChans; @@ -2215,13 +2215,17 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) device->AuxiliaryEffectSlotMax, device->NumAuxSends); if(ConfigValueBool(alstr_get_cstr(device->DeviceName), NULL, "output-limiter", &val)) - gainLimiter = val; - if(gainLimiter) + gainLimiter = val ? ALC_TRUE : ALC_FALSE; + /* Valid values for gainLimiter are ALC_DONT_CARE_SOFT, ALC_TRUE, and + * ALC_FALSE. We default to on, so ALC_DONT_CARE_SOFT is the same as + * ALC_TRUE. + */ + if(gainLimiter != ALC_FALSE) { if(!device->Limiter) device->Limiter = alloc_limiter(); } - else if(device->Limiter) + else { al_free(device->Limiter); device->Limiter = NULL; -- cgit v1.2.3