aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/panning.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/panning.cpp')
-rw-r--r--Alc/panning.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/Alc/panning.cpp b/Alc/panning.cpp
index e0677600..a67234ec 100644
--- a/Alc/panning.cpp
+++ b/Alc/panning.cpp
@@ -857,8 +857,8 @@ static void InitHrtfPanning(ALCdevice *device)
count = COUNTOF(IndexMap);
}
- device->mHrtfState = reinterpret_cast<DirectHrtfState*>(
- al_calloc(16, FAM_SIZE(DirectHrtfState, Chan, count)));
+ device->mHrtfState.reset(
+ new (al_calloc(16, FAM_SIZE(DirectHrtfState, Chan, count))) DirectHrtfState{});
for(i = 0;i < count;i++)
{
@@ -892,8 +892,8 @@ static void InitHrtfPanning(ALCdevice *device)
device->RealOut.NumChannels = ChannelsFromDevFmt(device->FmtChans, device->mAmbiOrder);
BuildBFormatHrtf(device->HrtfHandle,
- device->mHrtfState, device->Dry.NumChannels, AmbiPoints, AmbiMatrix, COUNTOF(AmbiPoints),
- AmbiOrderHFGain
+ device->mHrtfState.get(), device->Dry.NumChannels, AmbiPoints, AmbiMatrix,
+ COUNTOF(AmbiPoints), AmbiOrderHFGain
);
InitNearFieldCtrl(device, device->HrtfHandle->distance, device->AmbiUp ? 2 : 1,
@@ -930,7 +930,6 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, enum HrtfRequestMode hrtf
int bs2blevel;
size_t i;
- al_free(device->mHrtfState);
device->mHrtfState = nullptr;
device->HrtfHandle = nullptr;
device->HrtfName.clear();