aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mastering.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-09-25 23:05:27 -0700
committerChris Robinson <[email protected]>2018-09-25 23:05:27 -0700
commit79314c4461333c7dfd7d425d69ffd121d6c163b6 (patch)
treec73f512dba6a9ca1ed8bcc2f2e09768046ca5a70 /Alc/mastering.c
parent2d6309d6fc68e5c2f658b48e6e44ba10be42848e (diff)
Include the limiter's lookAhead delay in the device latency
Diffstat (limited to 'Alc/mastering.c')
-rw-r--r--Alc/mastering.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Alc/mastering.c b/Alc/mastering.c
index 78f6038d..a957066a 100644
--- a/Alc/mastering.c
+++ b/Alc/mastering.c
@@ -344,10 +344,10 @@ Compressor* CompressorInit(const ALuint NumChans, const ALuint SampleRate,
ALsizei hold;
size_t size;
- lookAhead = (ALsizei)minf(BUFFERSIZE, roundf(maxf(0.0f, LookAheadTime) * SampleRate));
- hold = (ALsizei)minf(BUFFERSIZE, roundf(maxf(0.0f, HoldTime) * SampleRate));
- size = sizeof(*Comp);
+ lookAhead = (ALsizei)clampf(roundf(LookAheadTime*SampleRate), 0.0f, BUFFERSIZE);
+ hold = (ALsizei)clampf(roundf(HoldTime*SampleRate), 0.0f, BUFFERSIZE);
+ size = sizeof(*Comp);
if(lookAhead > 0)
{
size += sizeof(*Comp->Delay) * NumChans;