diff options
author | Chris Robinson <[email protected]> | 2018-09-25 23:05:27 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-09-25 23:05:27 -0700 |
commit | 79314c4461333c7dfd7d425d69ffd121d6c163b6 (patch) | |
tree | c73f512dba6a9ca1ed8bcc2f2e09768046ca5a70 /Alc/mastering.c | |
parent | 2d6309d6fc68e5c2f658b48e6e44ba10be42848e (diff) |
Include the limiter's lookAhead delay in the device latency
Diffstat (limited to 'Alc/mastering.c')
-rw-r--r-- | Alc/mastering.c | 6 |
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; |