summaryrefslogtreecommitdiff
path: root/lib/libsndio
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2010-07-15 03:43:13 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2010-07-15 03:43:13 +0000
commit59cb4ff01f7202d2e69dd3011fd755605b7cc8da (patch)
tree454f4c2562bc96d6f292a0ddccc5df0e49f30ea2 /lib/libsndio
parenta6e9a1c865707ccd6904e98b221c6be74b97f4d9 (diff)
add two new members to structs audio_encoding and audio_prinfo.
for both structs, the new members are 'bps' and 'msb', which describe the number of bytes per sample and data alignment in the sample, respectively. drivers must properly set these fields in the 'query_encoding', 'set_parameters' and 'get_default_params' hardware interface methods. discussed with ratchov, deraadt
Diffstat (limited to 'lib/libsndio')
-rw-r--r--lib/libsndio/sun.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/libsndio/sun.c b/lib/libsndio/sun.c
index 962a0d3063e..9f603d890d6 100644
--- a/lib/libsndio/sun.c
+++ b/lib/libsndio/sun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sun.c,v 1.37 2010/05/25 06:49:13 ratchov Exp $ */
+/* $OpenBSD: sun.c,v 1.38 2010/07/15 03:43:11 jakemsr Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -88,9 +88,9 @@ static struct sio_ops sun_ops = {
static int
sun_infotoenc(struct sun_hdl *hdl, struct audio_prinfo *ai, struct sio_par *par)
{
- par->msb = 1;
+ par->msb = ai->msb;
par->bits = ai->precision;
- par->bps = SIO_BPS(par->bits);
+ par->bps = ai->bps;
switch (ai->encoding) {
case AUDIO_ENCODING_SLINEAR_LE:
par->le = 1;
@@ -267,8 +267,8 @@ sun_getcap(struct sio_hdl *sh, struct sio_cap *cap)
continue;
}
cap->enc[nenc].bits = ae.precision;
- cap->enc[nenc].bps = SIO_BPS(ae.precision);
- cap->enc[nenc].msb = 1;
+ cap->enc[nenc].bps = ae.bps;
+ cap->enc[nenc].msb = ae.msb;
enc_map |= (1 << nenc);
nenc++;
}
@@ -639,9 +639,9 @@ sun_setpar(struct sio_hdl *sh, struct sio_par *par)
return 0;
}
ibpf = (hdl->sio.mode & SIO_REC) ?
- aui.record.channels * SIO_BPS(aui.record.precision) : 1;
+ aui.record.channels * aui.record.bps : 1;
obpf = (hdl->sio.mode & SIO_PLAY) ?
- aui.play.channels * SIO_BPS(aui.play.precision) : 1;
+ aui.play.channels * aui.play.bps : 1;
DPRINTF("sun_setpar: bpf = (%u, %u)\n", ibpf, obpf);