aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-02-25 16:46:30 -0800
committerChris Robinson <[email protected]>2017-02-25 18:10:09 -0800
commit513c18fdc4d0d9184e061570209eb59f4ad0e392 (patch)
treebe71c303104b0dd998acd3be69211be580705952 /Alc/ALu.c
parent9539ccc18be1ddda6ef32c2d4bd4c15b4ed4115c (diff)
Ensure a non-playing or -paused source does not use a mixing voice
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 5a5e6fdf..3b83711f 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1427,7 +1427,10 @@ void aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
source = (*voice)->Source;
if(IsVoiceInit && source &&
ATOMIC_LOAD(&source->state, almemory_order_relaxed) == AL_PLAYING)
- MixSource(*voice, source, device, SamplesToDo);
+ {
+ if(!MixSource(*voice, source, device, SamplesToDo))
+ (*voice)->Source = NULL;
+ }
}
/* effect slot processing */