diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2007-11-05 00:17:29 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2007-11-05 00:17:29 +0000 |
commit | 807508d2835434424b1a9b4ff449247de67abb5e (patch) | |
tree | 82e12f7944552ddbee8fd3747e0acaad0779e686 /sys/dev/isa/sbdsp.c | |
parent | e9b7a83f6578c78422460eb291021722dc97c534 (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/dev/isa/sbdsp.c')
-rw-r--r-- | sys/dev/isa/sbdsp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/isa/sbdsp.c b/sys/dev/isa/sbdsp.c index 37eb608932c..c7a2a2a43f9 100644 --- a/sys/dev/isa/sbdsp.c +++ b/sys/dev/isa/sbdsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbdsp.c,v 1.25 2006/12/29 13:04:37 pedro Exp $ */ +/* $OpenBSD: sbdsp.c,v 1.26 2007/11/05 00:17:28 jakemsr Exp $ */ /* * Copyright (c) 1991-1993 Regents of the University of California. @@ -597,7 +597,7 @@ sbdsp_set_params(addr, setmode, usemode, play, rec) break; case AUDIO_ENCODING_ULAW: if (mode == AUMODE_PLAY) { - swcode = mulaw_to_ulinear16; + swcode = mulaw_to_ulinear16_le; factor = 2; m = &sbpmodes[PLAY16]; } else @@ -606,7 +606,7 @@ sbdsp_set_params(addr, setmode, usemode, play, rec) break; case AUDIO_ENCODING_ALAW: if (mode == AUMODE_PLAY) { - swcode = alaw_to_ulinear16; + swcode = alaw_to_ulinear16_le; factor = 2; m = &sbpmodes[PLAY16]; } else @@ -623,14 +623,14 @@ sbdsp_set_params(addr, setmode, usemode, play, rec) case AUDIO_ENCODING_SLINEAR_LE: break; case AUDIO_ENCODING_ULINEAR_LE: - swcode = change_sign16; + swcode = change_sign16_le; break; case AUDIO_ENCODING_SLINEAR_BE: swcode = swap_bytes; break; case AUDIO_ENCODING_ULINEAR_BE: swcode = mode == AUMODE_PLAY ? - swap_bytes_change_sign16 : change_sign16_swap_bytes; + swap_bytes_change_sign16_le : change_sign16_swap_bytes_le; break; case AUDIO_ENCODING_ULAW: swcode = mode == AUMODE_PLAY ? @@ -705,7 +705,7 @@ sbdsp_set_params(addr, setmode, usemode, play, rec) DPRINTF(("sbdsp_set_params: fd=%d, usemode=%d, idma=%d, odma=%d\n", sc->sc_fullduplex, usemode, sc->sc_i.dmachan, sc->sc_o.dmachan)); if (sc->sc_o.dmachan == sc->sc_drq8) { /* Use 16 bit DMA for playing by expanding the samples. */ - play->sw_code = linear8_to_linear16; + play->sw_code = linear8_to_linear16_le; play->factor = 2; sc->sc_o.modep = &sbpmodes[PLAY16]; sc->sc_o.dmachan = sc->sc_drq16; |