summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2010-02-10 23:03:53 +0000
committerratchov <ratchov@openbsd.org>2010-02-10 23:03:53 +0000
commit6d828780e4379e705cdf4ee8af84f934b9ffa87b (patch)
treee71e5f358ba355a96f39cece3b4c348695c2b8a6
parentremove lingering debug print. (diff)
downloadwireguard-openbsd-6d828780e4379e705cdf4ee8af84f934b9ffa87b.tar.xz
wireguard-openbsd-6d828780e4379e705cdf4ee8af84f934b9ffa87b.zip
Fix sio_getcap() for audio(4) devices exposing encodings
with precision other than 8, 16 or 32 bits. Found by Jan Stary <hans at stare.cz>, thanks!
-rw-r--r--lib/libsndio/sun.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libsndio/sun.c b/lib/libsndio/sun.c
index 55e745d1440..2e8502cd203 100644
--- a/lib/libsndio/sun.c
+++ b/lib/libsndio/sun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sun.c,v 1.26 2009/12/02 08:19:11 ratchov Exp $ */
+/* $OpenBSD: sun.c,v 1.27 2010/02/10 23:03:53 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -270,8 +270,8 @@ sun_getcap(struct sio_hdl *sh, struct sio_cap *cap)
continue;
}
cap->enc[nenc].bits = ae.precision;
- cap->enc[nenc].bps = ae.precision / 8;
- cap->enc[nenc].msb = 0;
+ cap->enc[nenc].bps = SIO_BPS(ae.precision);
+ cap->enc[nenc].msb = 1;
enc_map |= (1 << nenc);
nenc++;
}