diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2007-07-31 03:11:15 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2007-07-31 03:11:15 +0000 |
commit | eab0ef64048c2017a94d0f37e9bd135b648789db (patch) | |
tree | 13803cca0499581e3aa9c4d5dce7cac72da78b30 /sys | |
parent | 147d308aa2dd46199645966fe10f04dd895cb1dc (diff) |
always ignore attempts to set the record or play port to 0.
this interface to mixer functionality is very limited, and is only
used for recording. it only recognizes 'mic', 'cd', and 'line' as
valid recording inputs. many devices have other inputs. because of
the way AUDIO_INITINFO works, it is impossible to expand this API to
include all devices.
this fixes another common cause of audioctl(1) problems. AUDIO_GETINFO
returns 0 for record.port when the recording port is something other
than 'mic', 'cd', or 'line', and the subsequent AUDIO_SETINFO would
fail on this.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/audio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c index 01215dba92c..3a603e8b34b 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audio.c,v 1.68 2007/07/18 19:27:08 jakemsr Exp $ */ +/* $OpenBSD: audio.c,v 1.69 2007/07/31 03:11:14 jakemsr Exp $ */ /* $NetBSD: audio.c,v 1.119 1999/11/09 16:50:47 augustss Exp $ */ /* @@ -2359,8 +2359,8 @@ au_set_port(struct audio_softc *sc, struct au_mixer_ports *ports, u_int port) mixer_ctrl_t ct; int i, error; - if (port == 0 && ports->allports == 0) - return 0; /* allow this special case */ + if (port == 0) /* allow this special case */ + return 0; if (ports->index == -1) return EINVAL; |