Sorted the proper array

The wrong array was sorted when trying to find a voice to steal
This commit is contained in:
Paul Ferrand 2020-02-18 11:55:31 +01:00 committed by GitHub
parent a59734f000
commit 8941f0a800
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -348,7 +348,7 @@ sfz::Voice* sfz::Synth::findFreeVoice() noexcept
for (auto& voice : voices)
if (voice->canBeStolen())
voiceViewArray.push_back(voice.get());
absl::c_sort(voices, [](const auto& lhs, const auto& rhs) { return lhs->getSourcePosition() > rhs->getSourcePosition(); });
absl::c_sort(voiceViewArray, [](const auto& lhs, const auto& rhs) { return lhs->getSourcePosition() > rhs->getSourcePosition(); });
for (auto* voice : voiceViewArray) {
if (voice->getMeanSquaredAverage() < config::voiceStealingThreshold) {