Commit 324f54cf authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

Disallow setting a negative volume

MPris spec suggests "When setting, if a negative value is passed, the volume should be set to 0.0."
and also HTML5 player doesn't allow setting a volume below zero
parent 1ce07b1c
......@@ -307,6 +307,10 @@ qreal MPrisPlugin::volume() const
void MPrisPlugin::setVolume(qreal volume)
{
if (volume < 0) {
volume = 0.0;
}
sendData(QStringLiteral("setVolume"), {
{QStringLiteral("volume"), 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