diff options
author | Chris Robinson <[email protected]> | 2023-01-20 12:52:54 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-01-20 12:52:54 -0800 |
commit | c18bf15a37b01525f87d976e98ad4f62d6d288a6 (patch) | |
tree | b4cd7c1ce0617b2a89df50d61cf957e315b79ecf | |
parent | f80470bb228f8680917c6c4cd5306d9b5176cb3c (diff) |
Don't force an update if there is no aux slot being replaced
A null effect slot can't be deleted, so we don't need to make sure it's set to
change before returning.
-rw-r--r-- | al/source.cpp | 11 |
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; |