diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-10-17 09:12:16 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-10-17 09:12:16 +0200 |
commit | 1f726846f5e6f8137c6bcc1df53b61b35e3ae08d (patch) | |
tree | 67028640d791f0190cf7e8c97f67b40676c3f7d2 /dvbdevice.c | |
parent | 9f18dbc8cfa3446938656f1cea1ed18ff31ec386 (diff) | |
download | vdr-1f726846f5e6f8137c6bcc1df53b61b35e3ae08d.tar.gz vdr-1f726846f5e6f8137c6bcc1df53b61b35e3ae08d.tar.bz2 |
Refined formula for making volume control more linear
Diffstat (limited to 'dvbdevice.c')
-rw-r--r-- | dvbdevice.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/dvbdevice.c b/dvbdevice.c index 6bee3edc..561b6c62 100644 --- a/dvbdevice.c +++ b/dvbdevice.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.c 1.96 2004/10/16 14:38:24 kls Exp $ + * $Id: dvbdevice.c 1.97 2004/10/17 09:10:43 kls Exp $ */ #include "dvbdevice.h" @@ -786,10 +786,7 @@ void cDvbDevice::SetVolumeDevice(int Volume) if (HasDecoder()) { audio_mixer_t am; // conversion for linear volume response: - int i, Vol; - for (i = 1, Vol = 0; i < Volume; i++) - Vol += (256 - i) * (256 - i); - am.volume_left = am.volume_right = Vol / 21718; + am.volume_left = am.volume_right = 2 * Volume - Volume * Volume / 255; CHECK(ioctl(fd_audio, AUDIO_SET_MIXER, &am)); } } |