aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-05-09 14:22:26 -0700
committerChris Robinson <[email protected]>2016-05-09 14:22:26 -0700
commit182c0cb61abaff36554653d6a94c8a66fc263411 (patch)
treee6730a50f966dbad7aea9a62b10628bdd7508d0d /Alc/ALc.c
parentc2611f10ab5bdffe1aa0be4d4ec61662d868fde5 (diff)
Find a valid source buffer before updating the voice
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index d083825b..f8eda9a5 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -2106,11 +2106,22 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
{
ALvoice *voice = &context->Voices[pos];
ALsource *source = voice->Source;
+ ALbufferlistitem *BufferListItem;
- if(source)
+ if(!source)
+ continue;
+
+ BufferListItem = ATOMIC_LOAD(&source->queue);
+ while(BufferListItem != NULL)
{
- ATOMIC_STORE(&source->NeedsUpdate, AL_FALSE);
- voice->Update(voice, source, context);
+ ALbuffer *buffer;
+ if((buffer=BufferListItem->buffer) != NULL)
+ {
+ ATOMIC_STORE(&source->NeedsUpdate, AL_FALSE);
+ voice->Update(voice, source, buffer, context);
+ break;
+ }
+ BufferListItem = BufferListItem->next;
}
}