diff options
author | Chris Robinson <[email protected]> | 2018-03-28 06:28:46 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-03-28 06:28:46 -0700 |
commit | 2b16ff3ca8411e27daf621e06a6e651309dbb6b8 (patch) | |
tree | a2b82697d4dff118fd48b02bc4cedc00719fe274 /Alc | |
parent | 5aecce5a0dfb7784bfa3cc72642255872e0a4061 (diff) |
Check all buffers to update a source with
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1523,8 +1523,11 @@ static void CalcSourceParams(ALvoice *voice, ALCcontext *context, bool force) BufferListItem = ATOMIC_LOAD(&voice->current_buffer, almemory_order_relaxed); while(BufferListItem != NULL) { - const ALbuffer *buffer; - if(BufferListItem->num_buffers >= 1 && (buffer=BufferListItem->buffers[0]) != NULL) + const ALbuffer *buffer = NULL; + ALsizei i = 0; + while(!buffer && i < BufferListItem->num_buffers) + buffer = BufferListItem->buffers[i]; + if(LIKELY(buffer)) { if(props->SpatializeMode == SpatializeOn || (props->SpatializeMode == SpatializeAuto && buffer->FmtChannels == FmtMono)) |