aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-04-10 10:11:15 -0400
committerDave Reisner <dreisner@archlinux.org>2013-04-10 10:12:43 -0400
commit7d987d2d5e18d60a3faa84edff8f9738ac90f068 (patch)
tree11e603100b058bc60d57d3516fa97c46ecde8ba5
parentb8e53640751c0e8086802d62ac0cbf4e4d10a30c (diff)
downloadmirror-ponymix-7d987d2d5e18d60a3faa84edff8f9738ac90f068.tar.gz
mirror-ponymix-7d987d2d5e18d60a3faa84edff8f9738ac90f068.tar.bz2
mirror-ponymix-7d987d2d5e18d60a3faa84edff8f9738ac90f068.zip
clamp max volume based on max(dev->vol(), 100)
Fixes GHI#17.
-rw-r--r--ponymix.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/ponymix.cc b/ponymix.cc
index 94cf607..a378ed0 100644
--- a/ponymix.cc
+++ b/ponymix.cc
@@ -317,7 +317,9 @@ static int adj_volume(PulseClient& ponymix,
errx(1, "error: failed to convert string to integer: %s", argv[0]);
}
- ponymix.SetVolumeRange(0, 100);
+ // Allow setting the volume over 100, but don't "clip" the level back down to
+ // 100 on adjustment.
+ ponymix.SetVolumeRange(0, std::max(device->Volume(), 100));
return !(ponymix.*adjust)(*device, delta);
}