From 224b54edc1ea76dcb9fa8496c9f5867e06c2e6bc Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Wed, 10 Feb 2010 23:03:54 +0000 Subject: Fix sio_getcap() for audio(4) devices exposing encodings with precision other than 8, 16 or 32 bits. Found by Jan Stary , thanks! --- lib/libsndio/sun.c | 6 +++--- 1 file 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 * @@ -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++; } -- cgit v1.2.3