aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alc.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-21 16:46:52 -0800
committerChris Robinson <[email protected]>2018-11-21 16:46:52 -0800
commitcc3e2a838f245770af3d773e8d2c461b9912e392 (patch)
tree1731cb65bf0be9f3de38f90f8730059a6c50ff5c /Alc/alc.cpp
parenteefc379a239820a0711683455f5fadb20c8dbaf9 (diff)
Use a unique_ptr for the Compressor
Diffstat (limited to 'Alc/alc.cpp')
-rw-r--r--Alc/alc.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp
index 2ad6c887..b942064f 100644
--- a/Alc/alc.cpp
+++ b/Alc/alc.cpp
@@ -2221,16 +2221,12 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
if(device->DitherDepth > 0.0f)
thrshld -= 1.0f / device->DitherDepth;
- al_free(device->Limiter);
- device->Limiter = CreateDeviceLimiter(device, std::log10(thrshld) * 20.0f);
- device->FixedLatency += (ALuint)(GetCompressorLookAhead(device->Limiter) *
+ device->Limiter.reset(CreateDeviceLimiter(device, std::log10(thrshld) * 20.0f));
+ device->FixedLatency += (ALuint)(GetCompressorLookAhead(device->Limiter.get()) *
DEVICE_CLOCK_RES / device->Frequency);
}
else
- {
- al_free(device->Limiter);
device->Limiter = nullptr;
- }
TRACE("Output limiter %s\n", device->Limiter ? "enabled" : "disabled");
aluSelectPostProcess(device);
@@ -2433,9 +2429,6 @@ ALCdevice_struct::~ALCdevice_struct()
al_free(Stablizer);
Stablizer = nullptr;
-
- al_free(Limiter);
- Limiter = nullptr;
}