Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107300392
D38060.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38060.diff
View Options
diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c
--- a/usr.sbin/mixer/mixer.c
+++ b/usr.sbin/mixer/mixer.c
@@ -42,8 +42,8 @@
static void printminfo(struct mixer *, int);
static void printdev(struct mixer *, int);
static void printrecsrc(struct mixer *, int); /* XXX: change name */
+static int set_dunit(struct mixer *, int);
/* Control handlers */
-static int mod_dunit(struct mix_dev *, void *);
static int mod_volume(struct mix_dev *, void *);
static int mod_mute(struct mix_dev *, void *);
static int mod_recsrc(struct mix_dev *, void *);
@@ -51,14 +51,6 @@
static int print_mute(struct mix_dev *, void *);
static int print_recsrc(struct mix_dev *, void *);
-static const mix_ctl_t ctl_dunit = {
- .parent_dev = NULL,
- .id = -1,
- .name = "default_unit",
- .mod = mod_dunit,
- .print = NULL
-};
-
int
main(int argc, char *argv[])
{
@@ -125,7 +117,7 @@
initctls(m);
- if (dflag && ctl_dunit.mod(m->dev, &dunit) < 0)
+ if (dflag && set_dunit(m, dunit) < 0)
goto parse;
if (sflag) {
printrecsrc(m, oflag);
@@ -316,20 +308,19 @@
}
static int
-mod_dunit(struct mix_dev *d, void *p)
+set_dunit(struct mixer *m, int dunit)
{
- int dunit = *((int *)p);
int n;
if ((n = mixer_get_dunit()) < 0) {
warn("cannot get default unit");
return (-1);
}
- if (mixer_set_dunit(d->parent_mixer, dunit) < 0) {
+ if (mixer_set_dunit(m, dunit) < 0) {
warn("cannot set default unit to: %d", dunit);
return (-1);
}
- printf("%s: %d -> %d\n", ctl_dunit.name, n, dunit);
+ printf("default_unit: %d -> %d\n", n, dunit);
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 13, 5:14 AM (19 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15776654
Default Alt Text
D38060.diff (1 KB)
Attached To
Mode
D38060: mixer: Fix default_unit switching with mixers that have no devices
Attached
Detach File
Event Timeline
Log In to Comment