aboutsummaryrefslogtreecommitdiffstats
path: root/al/source.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'al/source.cpp')
-rw-r--r--al/source.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/al/source.cpp b/al/source.cpp
index 1e4a5a50..8e67ac64 100644
--- a/al/source.cpp
+++ b/al/source.cpp
@@ -1717,7 +1717,13 @@ try {
send.LFReference = HIGHPASSFREQREF;
}
- if(slot != Source->Send[static_cast<ALuint>(values[1])].Slot && IsPlayingOrPaused(Source))
+ /* We must force an update if the current auxiliary slot is valid and
+ * about to be changed on an active source, in case the old slot is
+ * about to be deleted.
+ */
+ if(Source->Send[static_cast<ALuint>(values[1])].Slot
+ && slot != Source->Send[static_cast<ALuint>(values[1])].Slot
+ && IsPlayingOrPaused(Source))
{
/* Add refcount on the new slot, and release the previous slot */
if(slot) IncrementRef(slot->ref);
@@ -1725,9 +1731,6 @@ try {
DecrementRef(oldslot->ref);
Source->Send[static_cast<ALuint>(values[1])].Slot = slot;
- /* We must force an update if the auxiliary slot changed on an
- * active source, in case the slot is about to be deleted.
- */
Voice *voice{GetSourceVoice(Source, Context)};
if(voice) UpdateSourceProps(Source, voice, Context);
else Source->mPropsDirty = true;