diff options
author | Chris Robinson <[email protected]> | 2016-06-16 18:22:01 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-06-16 18:29:18 -0700 |
commit | 80da138d7f78ddb5a91b5644001d2aa1da4f7a61 (patch) | |
tree | b48f72867305cd596e2da82ea2e16369c0f99750 /Alc | |
parent | 697ee19f71183d7da87e58ca89d67830b30f9eb5 (diff) |
Ensure voices has been updated once before mixing them
Sometimes the mixer is temporarily prevented from applying updates, when
multiple sources need to be updated simultaneously for example, but does not
prevent mixing. If the mixer runs during that time and a voice was just
started, it would've mixed the voice without any internal properties being set
for it.
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1460,8 +1460,9 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) voice_end = voice + ctx->VoiceCount; for(;voice != voice_end;++voice) { + ALboolean IsVoiceInit = (voice->Step > 0); source = voice->Source; - if(source && source->state == AL_PLAYING) + if(source && source->state == AL_PLAYING && IsVoiceInit) MixSource(voice, source, device, SamplesToDo); } |