From da1fea6850501986d998e4561e250cc64d3fc3c4 Mon Sep 17 00:00:00 2001 From: xenakios Date: Tue, 28 Nov 2017 16:35:15 +0200 Subject: [PATCH] Check volume and loop xfade length in setters before entering mutex --- Source/PS_Source/StretchSource.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/PS_Source/StretchSource.cpp b/Source/PS_Source/StretchSource.cpp index 04b0384..c00b93c 100644 --- a/Source/PS_Source/StretchSource.cpp +++ b/Source/PS_Source/StretchSource.cpp @@ -131,6 +131,8 @@ void StretchAudioSource::setAudioBufferAsInputSource(AudioBuffer* buf, in void StretchAudioSource::setMainVolume(double decibels) { + if (decibels == m_main_volume) + return; std::lock_guard locker(m_mutex); m_main_volume = jlimit(-144.0, 12.0, decibels); ++m_param_change_count; @@ -138,6 +140,8 @@ void StretchAudioSource::setMainVolume(double decibels) void StretchAudioSource::setLoopXFadeLength(double lenseconds) { + if (lenseconds == m_loopxfadelen) + return; std::lock_guard locker(m_mutex); m_loopxfadelen = jlimit(0.0, 1.0, lenseconds); ++m_param_change_count;