summaryrefslogtreecommitdiff
path: root/sys/dev/pci/auich.c
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2007-08-02 07:43:42 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2007-08-02 07:43:42 +0000
commitb22eaa46195292e9f9419500b716ad479026bc85 (patch)
treea80c3ce68aac1ed066e76f496007611843d18f18 /sys/dev/pci/auich.c
parentbc50b462a5984954cde9e2128e296a12f26584d0 (diff)
add proper recording encodings to auich(4).
tested by brad@
Diffstat (limited to 'sys/dev/pci/auich.c')
-rw-r--r--sys/dev/pci/auich.c63
1 files changed, 49 insertions, 14 deletions
diff --git a/sys/dev/pci/auich.c b/sys/dev/pci/auich.c
index c2a434eaffc..1f22577d255 100644
--- a/sys/dev/pci/auich.c
+++ b/sys/dev/pci/auich.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auich.c,v 1.63 2006/12/29 13:04:37 pedro Exp $ */
+/* $OpenBSD: auich.c,v 1.64 2007/08/02 07:43:41 jakemsr Exp $ */
/*
* Copyright (c) 2000,2001 Michael Shalayeff
@@ -902,28 +902,63 @@ auich_set_params(v, setmode, usemode, play, rec)
rec->sw_code = 0;
switch(rec->encoding) {
case AUDIO_ENCODING_ULAW:
- rec->sw_code = ulinear8_to_mulaw;
+ rec->sw_code = slinear16_to_mulaw_le;
+ rec->factor = 2;
+ break;
+ case AUDIO_ENCODING_ALAW:
+ rec->sw_code = slinear16_to_alaw_le;
+ rec->factor = 2;
break;
case AUDIO_ENCODING_SLINEAR_LE:
- if (rec->precision == 8)
- rec->sw_code = change_sign8;
+ switch (rec->precision) {
+ case 8:
+ rec->sw_code = linear16_to_linear8_le;
+ rec->factor = 2;
+ break;
+ case 16:
+ break;
+ default:
+ return (EINVAL);
+ }
break;
case AUDIO_ENCODING_ULINEAR_LE:
- if (rec->precision == 16)
- rec->sw_code = change_sign16;
- break;
- case AUDIO_ENCODING_ALAW:
- rec->sw_code = ulinear8_to_alaw;
+ switch (rec->precision) {
+ case 8:
+ rec->sw_code = linear16_to_ulinear8_le;
+ rec->factor = 2;
+ break;
+ case 16:
+ rec->sw_code = change_sign16_le;
+ break;
+ default:
+ return (EINVAL);
+ }
break;
case AUDIO_ENCODING_SLINEAR_BE:
- if (rec->precision == 16)
+ switch (rec->precision) {
+ case 8:
+ rec->sw_code = linear16_to_linear8_le;
+ rec->factor = 2;
+ break;
+ case 16:
rec->sw_code = swap_bytes;
- else
- rec->sw_code = change_sign8;
+ break;
+ default:
+ return (EINVAL);
+ }
break;
case AUDIO_ENCODING_ULINEAR_BE:
- if (rec->precision == 16)
- rec->sw_code = swap_bytes_change_sign16;
+ switch (rec->precision) {
+ case 8:
+ rec->sw_code = linear16_to_ulinear8_le;
+ rec->factor = 2;
+ break;
+ case 16:
+ rec->sw_code = change_sign16_swap_bytes_le;
+ break;
+ default:
+ return (EINVAL);
+ }
break;
default:
return (EINVAL);