]> code.delx.au - pulseaudio/commit
alsa-mixer: Fix the assumption that volume is always positive
authorLu Guanqun <guanqun.lu@intel.com>
Thu, 26 May 2011 08:49:52 +0000 (16:49 +0800)
committerColin Guthrie <colin@mageia.org>
Mon, 30 May 2011 10:22:21 +0000 (11:22 +0100)
commit6efa693fe7628b74cb0d97af03fba55b0b4b9d0d
treee9e1ac43b2cfbad6ef27893234f2f1774bce783b
parentb0f5b8d2fab347a062fa6ed34ff2908a1c29a41d
alsa-mixer: Fix the assumption that volume is always positive

Add a variable to track whether the actual volume is set or not.
Suppose this:
min volume: -126 max volume: 0
then when user wants to set some constant volume to -10, it would fail.

While the alsa values are typically positive, some values are "funky"
and have negative values. It is desirable to fix this at the alsa
level so that the numbers are positive, but it's not technically
invalid, and thus we have to support it.

Discussed here:
http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/9832
and
http://thread.gmane.org/gmane.linux.alsa.devel/85459
src/modules/alsa/alsa-mixer.c