summaryrefslogtreecommitdiff
path: root/sys/arch/zaurus/dev
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2007-11-05 00:17:29 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2007-11-05 00:17:29 +0000
commit807508d2835434424b1a9b4ff449247de67abb5e (patch)
tree82e12f7944552ddbee8fd3747e0acaad0779e686 /sys/arch/zaurus/dev
parente9b7a83f6578c78422460eb291021722dc97c534 (diff)
audio encoding conversion cleanup
- the endianness of the conversions don't depend on the endianness of machine the conversions are built on, but the endianness of the audio data itself. choose encoding conversions explicitly, instead of relying on #defines based on the endianness of the machine. - replace home-grown conversions with comparable conversions in auconv.c and mulaw.c - use the proper conversion for ulinear_be:16 -> slinear_le:16 in auixp(4) thanks ajacoutot@ and sthen@ for !x86 testing
Diffstat (limited to 'sys/arch/zaurus/dev')
-rw-r--r--sys/arch/zaurus/dev/zaurus_audio.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/arch/zaurus/dev/zaurus_audio.c b/sys/arch/zaurus/dev/zaurus_audio.c
index dbe3b5004b5..d8ce681a6a5 100644
--- a/sys/arch/zaurus/dev/zaurus_audio.c
+++ b/sys/arch/zaurus/dev/zaurus_audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_audio.c,v 1.8 2005/08/18 13:23:02 robert Exp $ */
+/* $OpenBSD: zaurus_audio.c,v 1.9 2007/11/05 00:17:28 jakemsr Exp $ */
/*
* Copyright (c) 2005 Christopher Pascoe <pascoe@openbsd.org>
@@ -553,11 +553,11 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 4;
- play->sw_code = mulaw_to_slinear16_mts;
+ play->sw_code = mulaw_to_slinear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = mulaw_to_slinear16;
+ play->sw_code = mulaw_to_slinear16_le;
break;
default:
return (EINVAL);
@@ -569,11 +569,11 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 4;
- play->sw_code = linear8_to_linear16_mts;
+ play->sw_code = linear8_to_linear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = linear8_to_linear16;
+ play->sw_code = linear8_to_linear16_le;
break;
default:
return (EINVAL);
@@ -602,11 +602,11 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
case 1:
play->factor = 4;
play->sw_code =
- ulinear8_to_linear16_mts;
+ ulinear8_to_linear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = ulinear8_to_linear16;
+ play->sw_code = ulinear8_to_linear16_le;
break;
default:
return (EINVAL);
@@ -616,10 +616,10 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 2;
- play->sw_code = change_sign16_mts;
+ play->sw_code = change_sign16_le_mts;
break;
case 2:
- play->sw_code = change_sign16;
+ play->sw_code = change_sign16_le;
break;
default:
return (EINVAL);
@@ -633,10 +633,10 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
switch (play->channels) {
case 1:
play->factor = 4;
- play->sw_code = alaw_to_slinear16_mts;
+ play->sw_code = alaw_to_slinear16_le_mts;
case 2:
play->factor = 2;
- play->sw_code = alaw_to_slinear16;
+ play->sw_code = alaw_to_slinear16_le;
default:
return (EINVAL);
}
@@ -648,11 +648,11 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
case 1:
play->factor = 4;
play->sw_code =
- linear8_to_linear16_mts;
+ linear8_to_linear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = linear8_to_linear16;
+ play->sw_code = linear8_to_linear16_le;
break;
default:
return (EINVAL);
@@ -682,11 +682,11 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
case 1:
play->factor = 4;
play->sw_code =
- ulinear8_to_linear16_mts;
+ ulinear8_to_linear16_le_mts;
break;
case 2:
play->factor = 2;
- play->sw_code = ulinear8_to_linear16;
+ play->sw_code = ulinear8_to_linear16_le;
break;
default:
return (EINVAL);
@@ -697,11 +697,11 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
case 1:
play->factor = 2;
play->sw_code =
- change_sign16_swap_bytes_mts;
+ swap_bytes_change_sign16_le_mts;
break;
case 2:
play->sw_code =
- change_sign16_swap_bytes;
+ swap_bytes_change_sign16_le;
break;
default:
return (EINVAL);
@@ -732,7 +732,7 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
break;
case AUDIO_ENCODING_ULINEAR_LE:
if (rec->precision == 16)
- rec->sw_code = change_sign16;
+ rec->sw_code = change_sign16_le;
break;
case AUDIO_ENCODING_ALAW:
rec->sw_code = ulinear8_to_alaw;
@@ -745,7 +745,7 @@ zaudio_set_params(void *hdl, int setmode, int usemode,
break;
case AUDIO_ENCODING_ULINEAR_BE:
if (rec->precision == 16)
- rec->sw_code = swap_bytes_change_sign16;
+ rec->sw_code = change_sign16_swap_bytes_le;
break;
default:
return (EINVAL);