alsa/0007-mixer-simple-Support-dB-TLVs-for-CTL_SINGLE-controls.patch
Takashi Iwai b6a2495802 Accepting request 1124030 from home:tiwai:branches:multimedia:libs
- Backport upstream fixes for sequencer and mixer:
  0006-seq-Fix-invalid-sanity-check-in-snd_seq_set_input_bu.patch 
  0007-mixer-simple-Support-dB-TLVs-for-CTL_SINGLE-controls.patch 
  0008-seq-Clear-UMP-event-flag-for-legacy-apps.patch 
  0009-seq-Simplify-snd_seq_extract_output.patch 
  0010-seq-Check-protocol-compatibility-with-the-current-ve.patch 
- Clean up spec file

OBS-URL: https://build.opensuse.org/request/show/1124030
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=325
2023-11-07 15:01:46 +00:00

43 lines
1.2 KiB
Diff

From f202ec3c23abf16a2382acc0de35900173e32160 Mon Sep 17 00:00:00 2001
From: Hector Martin <marcan@marcan.st>
Date: Sat, 28 Oct 2023 21:33:29 +0900
Subject: [PATCH] mixer: simple: Support dB TLVs for CTL_SINGLE controls
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>
---
src/mixer/simple_none.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/mixer/simple_none.c b/src/mixer/simple_none.c
index 846b0ca92467..dd03fcf13d01 100644
--- a/src/mixer/simple_none.c
+++ b/src/mixer/simple_none.c
@@ -1155,11 +1155,12 @@ static selem_ctl_t *get_selem_ctl(selem_none_t *s, int dir)
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;
--
2.35.3