aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/alc.cpp6
-rw-r--r--Alc/effects/autowah.cpp6
-rw-r--r--Alc/effects/compressor.cpp6
-rw-r--r--Alc/effects/equalizer.cpp6
-rw-r--r--Alc/effects/modulator.cpp6
-rw-r--r--Alc/panning.cpp4
-rw-r--r--OpenAL32/Include/alu.h2
-rw-r--r--OpenAL32/alAuxEffectSlot.cpp2
8 files changed, 19 insertions, 19 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp
index 99247753..b68a16e0 100644
--- a/Alc/alc.cpp
+++ b/Alc/alc.cpp
@@ -2068,7 +2068,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
if(context->DefaultSlot)
{
ALeffectslot *slot = context->DefaultSlot.get();
- aluInitEffectPanning(slot);
+ aluInitEffectPanning(slot, device);
EffectState *state{slot->Effect.State};
state->mOutBuffer = device->Dry.Buffer;
@@ -2091,7 +2091,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
usemask &= ~(1_u64 << idx);
- aluInitEffectPanning(slot);
+ aluInitEffectPanning(slot, device);
EffectState *state{slot->Effect.State};
state->mOutBuffer = device->Dry.Buffer;
@@ -3453,7 +3453,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
void *ptr{al_calloc(16, sizeof(ALeffectslot))};
ALContext->DefaultSlot = std::unique_ptr<ALeffectslot>{new (ptr) ALeffectslot{}};
if(InitEffectSlot(ALContext->DefaultSlot.get()) == AL_NO_ERROR)
- aluInitEffectPanning(ALContext->DefaultSlot.get());
+ aluInitEffectPanning(ALContext->DefaultSlot.get(), dev.get());
else
{
ALContext->DefaultSlot = nullptr;
diff --git a/Alc/effects/autowah.cpp b/Alc/effects/autowah.cpp
index ad4daf8d..06628e25 100644
--- a/Alc/effects/autowah.cpp
+++ b/Alc/effects/autowah.cpp
@@ -117,12 +117,12 @@ void ALautowahState::update(const ALCcontext *context, const ALeffectslot *slot,
mFreqMinNorm = MIN_FREQ / device->Frequency;
mBandwidthNorm = (MAX_FREQ-MIN_FREQ) / device->Frequency;
- mOutBuffer = target.FOAOut->Buffer;
- mOutChannels = target.FOAOut->NumChannels;
+ mOutBuffer = target.Main->Buffer;
+ mOutChannels = target.Main->NumChannels;
for(size_t i{0u};i < slot->WetBuffer.size();++i)
{
auto coeffs = GetAmbiIdentityRow(i);
- ComputePanGains(target.FOAOut, coeffs.data(), slot->Params.Gain, mChans[i].TargetGains);
+ ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, mChans[i].TargetGains);
}
}
diff --git a/Alc/effects/compressor.cpp b/Alc/effects/compressor.cpp
index 99507661..12a8c886 100644
--- a/Alc/effects/compressor.cpp
+++ b/Alc/effects/compressor.cpp
@@ -76,12 +76,12 @@ void ALcompressorState::update(const ALCcontext* UNUSED(context), const ALeffect
{
mEnabled = props->Compressor.OnOff;
- mOutBuffer = target.FOAOut->Buffer;
- mOutChannels = target.FOAOut->NumChannels;
+ mOutBuffer = target.Main->Buffer;
+ mOutChannels = target.Main->NumChannels;
for(size_t i{0u};i < slot->WetBuffer.size();++i)
{
auto coeffs = GetAmbiIdentityRow(i);
- ComputePanGains(target.FOAOut, coeffs.data(), slot->Params.Gain, mGain[i]);
+ ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, mGain[i]);
}
}
diff --git a/Alc/effects/equalizer.cpp b/Alc/effects/equalizer.cpp
index 9abac6ea..c4d2e53f 100644
--- a/Alc/effects/equalizer.cpp
+++ b/Alc/effects/equalizer.cpp
@@ -149,12 +149,12 @@ void ALequalizerState::update(const ALCcontext *context, const ALeffectslot *slo
mChans[i].filter[3].copyParamsFrom(mChans[0].filter[3]);
}
- mOutBuffer = target.FOAOut->Buffer;
- mOutChannels = target.FOAOut->NumChannels;
+ mOutBuffer = target.Main->Buffer;
+ mOutChannels = target.Main->NumChannels;
for(size_t i{0u};i < slot->WetBuffer.size();++i)
{
auto coeffs = GetAmbiIdentityRow(i);
- ComputePanGains(target.FOAOut, coeffs.data(), slot->Params.Gain, mChans[i].TargetGains);
+ ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, mChans[i].TargetGains);
}
}
diff --git a/Alc/effects/modulator.cpp b/Alc/effects/modulator.cpp
index 5786b708..6bfab546 100644
--- a/Alc/effects/modulator.cpp
+++ b/Alc/effects/modulator.cpp
@@ -129,12 +129,12 @@ void ALmodulatorState::update(const ALCcontext *context, const ALeffectslot *slo
for(size_t i{1u};i < slot->WetBuffer.size();++i)
mChans[i].Filter.copyParamsFrom(mChans[0].Filter);
- mOutBuffer = target.FOAOut->Buffer;
- mOutChannels = target.FOAOut->NumChannels;
+ mOutBuffer = target.Main->Buffer;
+ mOutChannels = target.Main->NumChannels;
for(size_t i{0u};i < slot->WetBuffer.size();++i)
{
auto coeffs = GetAmbiIdentityRow(i);
- ComputePanGains(target.FOAOut, coeffs.data(), slot->Params.Gain, mChans[i].TargetGains);
+ ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, mChans[i].TargetGains);
}
}
diff --git a/Alc/panning.cpp b/Alc/panning.cpp
index 7e8accff..dbbad01b 100644
--- a/Alc/panning.cpp
+++ b/Alc/panning.cpp
@@ -1134,9 +1134,9 @@ no_hrtf:
}
-void aluInitEffectPanning(ALeffectslot *slot)
+void aluInitEffectPanning(ALeffectslot *slot, ALCdevice *device)
{
- const size_t count{4u};
+ const size_t count{AmbiChannelsFromOrder(device->mAmbiOrder)};
slot->WetBuffer.resize(count);
slot->WetBuffer.shrink_to_fit();
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index 8b496a45..9792026c 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -350,7 +350,7 @@ ResamplerFunc SelectResampler(Resampler resampler);
*/
void aluInitRenderer(ALCdevice *device, ALint hrtf_id, HrtfRequestMode hrtf_appreq, HrtfRequestMode hrtf_userreq);
-void aluInitEffectPanning(ALeffectslot *slot);
+void aluInitEffectPanning(ALeffectslot *slot, ALCdevice *device);
void aluSelectPostProcess(ALCdevice *device);
diff --git a/OpenAL32/alAuxEffectSlot.cpp b/OpenAL32/alAuxEffectSlot.cpp
index 07c6e69e..c6a2a213 100644
--- a/OpenAL32/alAuxEffectSlot.cpp
+++ b/OpenAL32/alAuxEffectSlot.cpp
@@ -237,7 +237,7 @@ ALeffectslot *AllocEffectSlot(ALCcontext *context)
alSetError(context, err, "Effect slot object initialization failed");
return nullptr;
}
- aluInitEffectPanning(slot);
+ aluInitEffectPanning(slot, device);
/* Add 1 to avoid source ID 0. */
slot->id = ((lidx<<6) | slidx) + 1;