summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2008-09-29 02:27:39 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2008-09-29 02:27:39 +0000
commit27799942532cddd2fb83912c0135a16ef0b80279 (patch)
tree6a1fc89f5358679cdc3a97230a815c16c9076487 /sys
parentfd63fb7aa08fcaebaca91493b6defa20e32742e9 (diff)
account for data expansion due to emulation in AUDIO_GET{I,O}OFFS
ioctls. ok ratchov@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/audio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c
index 98f2046ec19..00dec2c10d2 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audio.c,v 1.97 2008/08/10 12:03:53 krw Exp $ */
+/* $OpenBSD: audio.c,v 1.98 2008/09/29 02:27:38 jakemsr Exp $ */
/* $NetBSD: audio.c,v 1.119 1999/11/09 16:50:47 augustss Exp $ */
/*
@@ -1711,10 +1711,10 @@ audio_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
s = splaudio();
/* figure out where next DMA will start */
ao = (struct audio_offset *)addr;
- ao->samples = sc->sc_rr.stamp;
+ ao->samples = sc->sc_rr.stamp / sc->sc_rparams.factor;
ao->deltablks = (sc->sc_rr.stamp - sc->sc_rr.stamp_last) / sc->sc_rr.blksize;
sc->sc_rr.stamp_last = sc->sc_rr.stamp;
- ao->offset = sc->sc_rr.inp - sc->sc_rr.start;
+ ao->offset = (sc->sc_rr.inp - sc->sc_rr.start) / sc->sc_rparams.factor;
splx(s);
break;
@@ -1725,10 +1725,10 @@ audio_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
offs = sc->sc_pr.outp - sc->sc_pr.start + sc->sc_pr.blksize;
if (sc->sc_pr.start + offs >= sc->sc_pr.end)
offs = 0;
- ao->samples = sc->sc_pr.stamp;
+ ao->samples = sc->sc_pr.stamp / sc->sc_pparams.factor;
ao->deltablks = (sc->sc_pr.stamp - sc->sc_pr.stamp_last) / sc->sc_pr.blksize;
sc->sc_pr.stamp_last = sc->sc_pr.stamp;
- ao->offset = offs;
+ ao->offset = offs / sc->sc_pparams.factor;
splx(s);
break;