diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-10-16 14:39:45 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-10-16 14:39:45 +0200 |
commit | fe86d58ed8e6f8e2c19cd8ba3c0fdb391716e596 (patch) | |
tree | eaa78c523cf57041bdee7f218884fa01e76fdb14 /dvbdevice.c | |
parent | 7ba6dae69f7fe474601bdffa9ac8641d9274a5e8 (diff) | |
download | vdr-fe86d58ed8e6f8e2c19cd8ba3c0fdb391716e596.tar.gz vdr-fe86d58ed8e6f8e2c19cd8ba3c0fdb391716e596.tar.bz2 |
Made volume control more linear
Diffstat (limited to 'dvbdevice.c')
-rw-r--r-- | dvbdevice.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/dvbdevice.c b/dvbdevice.c index 45e32b28..6bee3edc 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.95 2004/10/16 12:51:56 kls Exp $ + * $Id: dvbdevice.c 1.96 2004/10/16 14:38:24 kls Exp $ */ #include "dvbdevice.h" @@ -785,7 +785,11 @@ void cDvbDevice::SetVolumeDevice(int Volume) { if (HasDecoder()) { audio_mixer_t am; - am.volume_left = am.volume_right = Volume; + // 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; CHECK(ioctl(fd_audio, AUDIO_SET_MIXER, &am)); } } |