diff --git a/SerialPrograms/Source/CommonFramework/AudioPipeline/AudioSession.cpp b/SerialPrograms/Source/CommonFramework/AudioPipeline/AudioSession.cpp index 4ced546c6..c1755c12c 100644 --- a/SerialPrograms/Source/CommonFramework/AudioPipeline/AudioSession.cpp +++ b/SerialPrograms/Source/CommonFramework/AudioPipeline/AudioSession.cpp @@ -170,6 +170,9 @@ void AudioSession::set_audio_output(AudioDeviceInfo info){ } void AudioSession::set_volume(double volume){ std::lock_guard lg(m_lock); + if (m_option.m_volume == volume){ + return; + } m_devices->set_sink_volume(volume); m_option.m_volume = volume; for (Listener* listener : m_listeners){ @@ -178,6 +181,9 @@ void AudioSession::set_volume(double volume){ } void AudioSession::set_display(AudioOption::AudioDisplayType display){ std::lock_guard lg(m_lock); + if (m_option.m_display_type == display){ + return; + } m_option.m_display_type = display; for (Listener* listener : m_listeners){ listener->display_changed(m_option.m_display_type);