aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/panning.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-22 04:53:29 -0800
committerChris Robinson <[email protected]>2018-11-22 04:53:29 -0800
commit671ed1abf8cc246c6e2b5f9ae3bac132fb9af519 (patch)
tree66402274da934f19f30da30b2acb8a25a6958a53 /Alc/panning.cpp
parentcc3e2a838f245770af3d773e8d2c461b9912e392 (diff)
Use a unique_ptr for the FrontStablizer
Diffstat (limited to 'Alc/panning.cpp')
-rw-r--r--Alc/panning.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/Alc/panning.cpp b/Alc/panning.cpp
index c167c227..4ffdf969 100644
--- a/Alc/panning.cpp
+++ b/Alc/panning.cpp
@@ -931,8 +931,8 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, enum HrtfRequestMode hrtf
size_t i;
al_free(device->Hrtf);
- device->Hrtf = NULL;
- device->HrtfHandle = NULL;
+ device->Hrtf = nullptr;
+ device->HrtfHandle = nullptr;
device->HrtfName.clear();
device->Render_Mode = NormalRender;
@@ -945,8 +945,7 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, enum HrtfRequestMode hrtf
device->AvgSpeakerDist = 0.0f;
device->ChannelDelay.clear();
- al_free(device->Stablizer);
- device->Stablizer = NULL;
+ device->Stablizer = nullptr;
if(device->FmtChans != DevFmtStereo)
{
@@ -1035,8 +1034,7 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, enum HrtfRequestMode hrtf
* higher).
*/
ALfloat scale = (ALfloat)(5000.0 / device->Frequency);
- FrontStablizer *stablizer = reinterpret_cast<FrontStablizer*>(
- al_calloc(16, sizeof(*stablizer)));
+ std::unique_ptr<FrontStablizer> stablizer{new FrontStablizer{}};
bandsplit_init(&stablizer->LFilter, scale);
stablizer->RFilter = stablizer->LFilter;
@@ -1046,7 +1044,7 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, enum HrtfRequestMode hrtf
for(i = 1;i < (size_t)device->RealOut.NumChannels;i++)
stablizer->APFilter[i] = stablizer->APFilter[0];
- device->Stablizer = stablizer;
+ device->Stablizer = std::move(stablizer);
}
break;
case DevFmtMono: