aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-03-28 06:28:46 -0700
committerChris Robinson <[email protected]>2018-03-28 06:28:46 -0700
commit2b16ff3ca8411e27daf621e06a6e651309dbb6b8 (patch)
treea2b82697d4dff118fd48b02bc4cedc00719fe274 /Alc
parent5aecce5a0dfb7784bfa3cc72642255872e0a4061 (diff)
Check all buffers to update a source with
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index fef50feb..add3602c 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -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))