diff options
author | Chris Robinson <[email protected]> | 2016-05-09 14:22:26 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-05-09 14:22:26 -0700 |
commit | 182c0cb61abaff36554653d6a94c8a66fc263411 (patch) | |
tree | e6730a50f966dbad7aea9a62b10628bdd7508d0d /Alc/ALc.c | |
parent | c2611f10ab5bdffe1aa0be4d4ec61662d868fde5 (diff) |
Find a valid source buffer before updating the voice
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -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; } } |