summaryrefslogtreecommitdiffstats
path: root/src/pulse/volume.c
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2009-08-16 21:25:48 +0300
committerTanu Kaskinen <tanuk@iki.fi>2009-08-16 21:25:48 +0300
commitbcaba0b1b43d6a1b32aadfa98860f40b2c93e136 (patch)
tree6bd0d60a8fa822bfd688b90d062d0f73eee2e47e /src/pulse/volume.c
parent2bb3eef414f80189cf6af6cd66c519630e4c0a43 (diff)
parent01e4b61a910afdd21f860fadbe98075735c2bf51 (diff)
Merge branch 'master' of git://0pointer.de/pulseaudio into dbus-work
Conflicts: src/Makefile.am src/daemon/daemon-conf.c src/daemon/daemon.conf.in src/modules/module-stream-restore.c src/pulse/client-conf.c src/pulsecore/namereg.c
Diffstat (limited to 'src/pulse/volume.c')
-rw-r--r--src/pulse/volume.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pulse/volume.c b/src/pulse/volume.c
index 42cde5b9..c23f360b 100644
--- a/src/pulse/volume.c
+++ b/src/pulse/volume.c
@@ -205,9 +205,12 @@ pa_volume_t pa_sw_volume_from_linear(double v) {
*
* http://www.robotplanet.dk/audio/audio_gui_design/
* http://lists.linuxaudio.org/pipermail/linux-audio-dev/2009-May/thread.html#23151
+ *
+ * We make sure that the conversion to linear and back yields the
+ * same volume value! That's why we need the lround() below!
*/
- return (pa_volume_t) (cbrt(v) * PA_VOLUME_NORM);
+ return (pa_volume_t) lround(cbrt(v) * PA_VOLUME_NORM);
}
double pa_sw_volume_to_linear(pa_volume_t v) {