aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--alc/voice.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/alc/voice.cpp b/alc/voice.cpp
index 022d0b91..c3735acb 100644
--- a/alc/voice.cpp
+++ b/alc/voice.cpp
@@ -542,7 +542,15 @@ void ALvoice::mix(const State vstate, ALCcontext *Context, const ALuint SamplesT
const ALuint NumChannels{mNumChannels};
const ALuint SampleSize{mSampleSize};
const ALuint increment{mStep};
- if(increment < 1) return;
+ if UNLIKELY(increment < 1)
+ {
+ /* If the voice is supposed to be stopping but can't be mixed, just
+ * stop it before bailing.
+ */
+ if(vstate == ALvoice::Stopping)
+ mPlayState.store(ALvoice::Stopped, std::memory_order_release);
+ return;
+ }
ASSUME(NumChannels > 0);
ASSUME(SampleSize > 0);