dB mappings do not work for controls not named "* Volume", since we do not
fall back to CTL_SINGLE in get_selem_ctl. Add that branch to make it
work.
Fixes dB ranges for e.g. controls named "* Gain".
Closes: https://github.com/alsa-project/alsa-lib/pull/358
Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
c = &s->ctls[CTL_CAPTURE_VOLUME];
else
return NULL;
- if (! c->elem) {
+ if (! c->elem)
c = &s->ctls[CTL_GLOBAL_VOLUME];
- if (! c->elem)
- return NULL;
- }
+ if (! c->elem)
+ c = &s->ctls[CTL_SINGLE];
+ if (! c->elem)
+ return NULL;
if (c->type != SND_CTL_ELEM_TYPE_INTEGER)
return NULL;
return c;