summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2008-04-04 04:57:17 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2008-04-04 04:57:17 +0000
commit49a2d4e7e49d178ce6353cc862d684fee32c3ce4 (patch)
tree640a087ea13c65ed7d5e90b5c73c2f94dfae05a1
parent3b2fde471d88f091cd07ee7e10c7623ad2c271a0 (diff)
if full-duplex is being turned on, also set the oprtational mode to
for both recording and playback. ok ratchov
-rw-r--r--sys/dev/audio.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c
index 83196eb57c8..bfcefa24863 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audio.c,v 1.93 2008/03/22 11:05:31 ratchov Exp $ */
+/* $OpenBSD: audio.c,v 1.94 2008/04/04 04:57:16 jakemsr Exp $ */
/* $NetBSD: audio.c,v 1.119 1999/11/09 16:50:47 augustss Exp $ */
/*
@@ -1622,6 +1622,7 @@ audio_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
struct audio_softc *sc = audio_cd.cd_devs[unit];
struct audio_hw_if *hw = sc->hw_if;
struct audio_offset *ao;
+ struct audio_info ai;
int error = 0, s, offs, fd;
int rbus, pbus;
@@ -1768,8 +1769,15 @@ audio_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
error = hw->setfd(sc->hw_hdl, fd);
else
error = 0;
- if (!error)
+ if (!error) {
sc->sc_full_duplex = fd;
+ if (fd) {
+ AUDIO_INITINFO(&ai);
+ ai.mode = sc->sc_mode |
+ (AUMODE_PLAY | AUMODE_RECORD);
+ error = audiosetinfo(sc, &ai);
+ }
+ }
} else {
if (fd)
error = ENOTTY;