Commit 3ad38ca6 authored by Michael Pyne's avatar Michael Pyne

Don't update volume from DBus if the change is microscopic.

Floating point fun! Seems some DBus-based media player managers see a
volume change, sends the new volume to Juk, Juk updates and sends back
over DBus, repeat loop. Not very efficient for CPU...
parent c2660b67
...@@ -570,8 +570,11 @@ void PlayerManager::slotMutedChanged(bool muted) ...@@ -570,8 +570,11 @@ void PlayerManager::slotMutedChanged(bool muted)
if(!output) if(!output)
return; return;
if(output != m_output[m_curOutputPath]) if(output != m_output[m_curOutputPath] ||
m_output[m_curOutputPath]->isMuted() == muted)
{
return; return;
}
emit mutedChanged(muted); emit mutedChanged(muted);
} }
...@@ -583,8 +586,11 @@ void PlayerManager::slotVolumeChanged(qreal volume) ...@@ -583,8 +586,11 @@ void PlayerManager::slotVolumeChanged(qreal volume)
if(!output) if(!output)
return; return;
if(output != m_output[m_curOutputPath]) if(output != m_output[m_curOutputPath] ||
qFuzzyCompare(m_output[m_curOutputPath]->volume(), volume))
{
return; return;
}
emit volumeChanged(volume); emit volumeChanged(volume);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment