vuplus: fix volume 0

Origin commit data
------------------
Branch: master
Commit: 51b7100513
Author: vanhofen <vanhofen@gmx.de>
Date: 2019-12-13 (Fri, 13 Dec 2019)

Origin message was:
------------------
- vuplus: fix volume 0

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2019-12-13 22:14:55 +01:00
parent d9a2267914
commit 265a203f2a
3 changed files with 79 additions and 26 deletions

View File

@@ -92,7 +92,15 @@ int map_volume(const int volume)
if (vol > 100)
vol = 100;
// convert to -1dB steps
vol = 63 - vol * 63 / 100;
// now range is 63..0, where 0 is loudest
#if BOXMODEL_VUPLUS4K
if (vol == 63)
vol = 255;
#endif
return vol;
}
@@ -103,10 +111,8 @@ int cAudio::setVolume(unsigned int left, unsigned int right)
volume = (left + right) / 2;
int v = map_volume(volume);
// convert to -1dB steps
left = map_volume(volume);
right = map_volume(volume);
//now range is 63..0, where 0 is loudest
audio_mixer_t mixer;