diff options
| author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2020-03-26 07:42:36 +0000 |
|---|---|---|
| committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2020-03-26 07:42:36 +0000 |
| commit | edabe1ee6da50aaa9c4a5e0bfe9b8c66ee4c610a (patch) | |
| tree | 36c497e25f3900b8277f94155bd7c214e299fee2 /sys/dev/sound | |
| parent | 7e88777b24675aba085fbc87b4d21732ba99e26c (diff) | |
Notes
Diffstat (limited to 'sys/dev/sound')
| -rw-r--r-- | sys/dev/sound/usb/uaudio.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index e63d0c4b40f63..e2e15e49803ff 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -5380,25 +5380,19 @@ uaudio_mixer_bsd2value(struct uaudio_mixer_node *mc, int val) { if (mc->type == MIX_ON_OFF) { val = (val != 0); - } else if (mc->type == MIX_SELECTOR) { - if ((val < mc->minval) || - (val > mc->maxval)) { - val = mc->minval; - } - } else { + } else if (mc->type != MIX_SELECTOR) { /* compute actual volume */ val = (val * mc->mul) / 100; /* add lower offset */ val = val + mc->minval; - - /* make sure we don't write a value out of range */ - if (val > mc->maxval) - val = mc->maxval; - else if (val < mc->minval) - val = mc->minval; } + /* make sure we don't write a value out of range */ + if (val > mc->maxval) + val = mc->maxval; + else if (val < mc->minval) + val = mc->minval; DPRINTFN(6, "type=0x%03x val=%d min=%d max=%d val=%d\n", mc->type, val, mc->minval, mc->maxval, val); |
