Skip to content

Commit 017b99c

Browse files
Pull up following revision(s) (requested by nia in ticket NetBSD#77):
usr.bin/aiomixer/parse.c: revision 1.4 aiomixer(1): always put "master" controls first
1 parent 2280e42 commit 017b99c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

usr.bin/aiomixer/parse.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: parse.c,v 1.3 2021/05/08 13:03:40 nia Exp $ */
1+
/* $NetBSD: parse.c,v 1.3.10.1 2025/10/28 14:56:58 martin Exp $ */
22
/*-
33
* Copyright (c) 2021 The NetBSD Foundation, Inc.
44
* All rights reserved.
@@ -64,6 +64,14 @@ compare_control(const void *pa, const void *pb)
6464
if (a->info.prev == b->info.index)
6565
return 1;
6666
} else {
67+
/* put "master" controls first */
68+
if (strstr(a->info.label.name, AudioNmaster) != NULL) {
69+
if (strstr(b->info.label.name, AudioNmaster) == NULL) {
70+
return -1;
71+
}
72+
} else if (strstr(b->info.label.name, AudioNmaster) != NULL) {
73+
return 1;
74+
}
6775
return strcmp(a->info.label.name, b->info.label.name);
6876
}
6977
return 0;

0 commit comments

Comments
 (0)