aboutsummaryrefslogtreecommitdiffstats
path: root/alc/alc.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-01-24 02:07:39 -0800
committerChris Robinson <[email protected]>2021-01-24 02:07:39 -0800
commit13c1d7efb7141aee93d32a60c0e609e61a64f550 (patch)
treec788c53507811f8adb8a33ee668c014f66d9b8fa /alc/alc.cpp
parent3142fb30eaa451c955a1607b8cffe2069cbd15b2 (diff)
Store buffer info in the queue entry
Diffstat (limited to 'alc/alc.cpp')
-rw-r--r--alc/alc.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp
index 02aaaa18..cc2a9536 100644
--- a/alc/alc.cpp
+++ b/alc/alc.cpp
@@ -2102,6 +2102,11 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList)
FPUCtl mixer_mode{};
for(ALCcontext *context : *device->mContexts.load())
{
+ auto GetEffectBuffer = [](ALbuffer *buffer) noexcept -> EffectState::Buffer
+ {
+ if(!buffer) return EffectState::Buffer{};
+ return EffectState::Buffer{buffer, buffer->mData};
+ };
std::unique_lock<std::mutex> proplock{context->mPropLock};
std::unique_lock<std::mutex> slotlock{context->mEffectSlotLock};
@@ -2118,7 +2123,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList)
EffectState *state{slot->Effect.State.get()};
state->mOutTarget = device->Dry.Buffer;
- state->deviceUpdate(device, slot->Buffer);
+ state->deviceUpdate(device, GetEffectBuffer(slot->Buffer));
slot->updateProps(context);
}
@@ -2137,7 +2142,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList)
EffectState *state{slot->Effect.State.get()};
state->mOutTarget = device->Dry.Buffer;
- state->deviceUpdate(device, slot->Buffer);
+ state->deviceUpdate(device, GetEffectBuffer(slot->Buffer));
slot->updateProps(context);
}
}