]> Some of my projects - aniplayer.git/commitdiff
Only notify volume has changed if it really did
authorAPTX <marek321@gmail.com>
Mon, 21 Feb 2022 13:22:17 +0000 (22:22 +0900)
committerAPTX <marek321@gmail.com>
Mon, 21 Feb 2022 13:22:17 +0000 (22:22 +0900)
core/player.cpp

index 559c7743cad7f56efae3e9931149c8ad525fee3b..6b6765140d7941f242730f1949850247d7e37362 100644 (file)
@@ -191,6 +191,10 @@ void Player::previous() {
 
 void Player::setVolume(Volume volume) {
   volume = qBound(Volume{}, volume, m_maxVolume);
+
+  if (qFuzzyCompare(m_volume, volume))
+    return;
+
   m_backend->setVolume(volume);
 }