aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-05-11 11:04:25 -0700
committerChris Robinson <[email protected]>2017-05-11 11:04:25 -0700
commita6f6533a28fd68c4e552353235b9a2a7aeffa0cd (patch)
treef5f45fc8d48a0043c0ad112c42c63334ddd001dc
parenta2c25378a970792461c961054e2b47cd3a086e05 (diff)
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.
-rw-r--r--Alc/ALc.c12
1 files 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;