aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALu.c')
-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))