diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2010-07-15 03:43:13 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2010-07-15 03:43:13 +0000 |
commit | 59cb4ff01f7202d2e69dd3011fd755605b7cc8da (patch) | |
tree | 454f4c2562bc96d6f292a0ddccc5df0e49f30ea2 /sys/arch/sgi/dev | |
parent | a6e9a1c865707ccd6904e98b221c6be74b97f4d9 (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 'sys/arch/sgi/dev')
-rw-r--r-- | sys/arch/sgi/dev/mavb.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/arch/sgi/dev/mavb.c b/sys/arch/sgi/dev/mavb.c index 78deca07723..b6fe1327577 100644 --- a/sys/arch/sgi/dev/mavb.c +++ b/sys/arch/sgi/dev/mavb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mavb.c,v 1.12 2010/07/02 03:24:50 blambert Exp $ */ +/* $OpenBSD: mavb.c,v 1.13 2010/07/15 03:43:11 jakemsr Exp $ */ /* * Copyright (c) 2005 Mark Kettenis @@ -262,6 +262,8 @@ mavb_query_encoding(void *hdl, struct audio_encoding *ae) default: return (EINVAL); } + ae->bps = AUDIO_BPS(ae->precision); + ae->msb = 1; return (0); } @@ -374,6 +376,8 @@ mavb_get_default_params(void *hdl, int mode, struct audio_params *p) p->sample_rate = 48000; p->encoding = AUDIO_ENCODING_SLINEAR_BE; p->precision = 16; + p->bps = 2; + p->msb = 1; p->channels = 2; p->factor = 2; if (mode == AUMODE_PLAY) @@ -535,6 +539,9 @@ mavb_set_params(void *hdl, int setmode, int usemode, error = mavb_set_play_format(sc, play->encoding); if (error) return (error); + + play->bps = AUDIO_BPS(play->precision); + play->msb = 1; } if (setmode & AUMODE_RECORD) { @@ -569,6 +576,9 @@ mavb_set_params(void *hdl, int setmode, int usemode, error = mavb_set_rec_format(sc, rec->encoding); if (error) return (error); + + rec->bps = AUDIO_BPS(rec->precision); + rec->msb = 1; } return (0); |