aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-05-04 13:53:11 -0700
committerChris Robinson <[email protected]>2019-05-04 13:53:11 -0700
commit1607f9c525eedb4af5b736990fd4e6640f37def0 (patch)
treecf05dc7b501eb9c880ac36de14267f4d5e1df1e7
parent9eea2e4c7387de1a310e1085c3661fff3fe6209d (diff)
Report the threshold limit for the output limiter
-rw-r--r--Alc/alc.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp
index 7c218785..3bc365c8 100644
--- a/Alc/alc.cpp
+++ b/Alc/alc.cpp
@@ -2008,7 +2008,9 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
break;
}
}
- if(gainLimiter != ALC_FALSE)
+ if(gainLimiter == ALC_FALSE)
+ TRACE("Output limiter disabled\n");
+ else
{
ALfloat thrshld = 1.0f;
switch(device->FmtType)
@@ -2029,12 +2031,13 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
if(device->DitherDepth > 0.0f)
thrshld -= 1.0f / device->DitherDepth;
- auto limiter = CreateDeviceLimiter(device, std::log10(thrshld) * 20.0f);
+ const float thrshld_dB{std::log10(thrshld) * 20.0f};
+ auto limiter = CreateDeviceLimiter(device, thrshld_dB);
/* Convert the lookahead from samples to nanosamples to nanoseconds. */
device->FixedLatency += nanoseconds{seconds{limiter->getLookAhead()}} / device->Frequency;
device->Limiter = std::move(limiter);
+ TRACE("Output limiter enabled, %.4fdB limit\n", thrshld_dB);
}
- TRACE("Output limiter %s\n", device->Limiter ? "enabled" : "disabled");
aluSelectPostProcess(device);