diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2010-02-10 23:03:54 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2010-02-10 23:03:54 +0000 |
commit | 224b54edc1ea76dcb9fa8496c9f5867e06c2e6bc (patch) | |
tree | b97f57deada0cb93464ff57c075a2ec38f7a60f7 /lib | |
parent | 65570536d2ebfb0b8f1ffcd53a106238ac60b77e (diff) |
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!
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libsndio/sun.c | 6 |
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++; } |