* [PATCH alsa-lib] mixer: simple - Fix "Capture Volume" and "Capture Switch" being seen as global controls
@ 2021-05-04 15:58 Hans de Goede
2021-05-04 16:22 ` Jaroslav Kysela
0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2021-05-04 15:58 UTC (permalink / raw)
To: Jaroslav Kysela, alsa-devel; +Cc: Hans de Goede
Fix the "Capture Volume" and "Capture Switch" exceptions no longer
working after commit 86b9c67774bc ("mixer: simple - Unify simple_none:
base_len() exception handling") because they were moved to after the
suffix checking, so they would be treated as CTL_GLOBAL_VOLUME resp.
CTL_GLOBAL_SWITCH based on their suffix before the exception check
has a chance to check for a match.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
src/mixer/simple_none.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/mixer/simple_none.c b/src/mixer/simple_none.c
index 71d88486..9b9f0000 100644
--- a/src/mixer/simple_none.c
+++ b/src/mixer/simple_none.c
@@ -913,6 +913,16 @@ static int base_len(const char *name, selem_ctl_type_t *type)
const struct suf *p;
size_t nlen = strlen(name);
+ /* exception: "Capture Volume" and "Capture Switch" */
+ if (!strcmp(name, "Capture Volume")) {
+ *type = CTL_CAPTURE_VOLUME;
+ return strlen("Capture");
+ }
+ if (!strcmp(name, "Capture Switch")) {
+ *type = CTL_CAPTURE_SWITCH;
+ return strlen("Capture");
+ }
+
for (p = suffixes; p->suffix; p++) {
size_t slen = strlen(p->suffix);
size_t l;
@@ -926,16 +936,6 @@ static int base_len(const char *name, selem_ctl_type_t *type)
}
}
- /* exception: "Capture Volume" and "Capture Switch" */
- if (!strcmp(name, "Capture Volume")) {
- *type = CTL_CAPTURE_VOLUME;
- return strlen("Capture");
- }
- if (!strcmp(name, "Capture Switch")) {
- *type = CTL_CAPTURE_SWITCH;
- return strlen("Capture");
- }
-
/* Special case - handle "Input Source" as a capture route.
* Note that it's *NO* capture source. A capture source is split over
* sub-elements, and multiple capture-sources will result in an error.
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH alsa-lib] mixer: simple - Fix "Capture Volume" and "Capture Switch" being seen as global controls
2021-05-04 15:58 [PATCH alsa-lib] mixer: simple - Fix "Capture Volume" and "Capture Switch" being seen as global controls Hans de Goede
@ 2021-05-04 16:22 ` Jaroslav Kysela
0 siblings, 0 replies; 2+ messages in thread
From: Jaroslav Kysela @ 2021-05-04 16:22 UTC (permalink / raw)
To: Hans de Goede, alsa-devel
Dne 04. 05. 21 v 17:58 Hans de Goede napsal(a):
> Fix the "Capture Volume" and "Capture Switch" exceptions no longer
> working after commit 86b9c67774bc ("mixer: simple - Unify simple_none:
> base_len() exception handling") because they were moved to after the
> suffix checking, so they would be treated as CTL_GLOBAL_VOLUME resp.
> CTL_GLOBAL_SWITCH based on their suffix before the exception check
> has a chance to check for a match.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Applied. Thank you.
Jaroslav
--
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-04 16:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04 15:58 [PATCH alsa-lib] mixer: simple - Fix "Capture Volume" and "Capture Switch" being seen as global controls Hans de Goede
2021-05-04 16:22 ` Jaroslav Kysela
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.