summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorkent <kent@NetBSD.org>2002-02-14 12:55:51 +0000
committerkent <kent@NetBSD.org>2002-02-14 12:55:51 +0000
commit46ffcfbf95feffee1a6b2ec7230a4b84e117c299 (patch)
tree9d4d3c1c19f06a8465af5ca9f8fa3ecf802971ab /sys/dev
parent4cb7d87b12c7f784e68520a920dd442fa6db25e0 (diff)
uaudio_set_params() for mulaw:
Give priority to 16bit again in the case the device has no hardware support for mulaw.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/uaudio.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c
index 2ed294e2e88..6f50ea24ae0 100644
--- a/sys/dev/usb/uaudio.c
+++ b/sys/dev/usb/uaudio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uaudio.c,v 1.47 2002/02/12 19:52:43 jdolecek Exp $ */
+/* $NetBSD: uaudio.c,v 1.48 2002/02/14 12:55:51 kent Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.47 2002/02/12 19:52:43 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.48 2002/02/14 12:55:51 kent Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -2217,7 +2217,15 @@ uaudio_set_params(void *addr, int setmode, int usemode,
case AUDIO_ENCODING_ULAW:
if (flags & HAS_MULAW)
break;
- if (flags & HAS_8U) {
+ if (flags & HAS_16) {
+ if (mode == AUMODE_PLAY)
+ swcode = mulaw_to_slinear16_le;
+ else
+ swcode = slinear16_to_mulaw_le;
+ factor = 2;
+ enc = AUDIO_ENCODING_SLINEAR_LE;
+ precision = 16;
+ } else if (flags & HAS_8U) {
if (mode == AUMODE_PLAY)
swcode = mulaw_to_ulinear8;
else
@@ -2229,14 +2237,6 @@ uaudio_set_params(void *addr, int setmode, int usemode,
else
swcode = slinear8_to_mulaw;
enc = AUDIO_ENCODING_SLINEAR_LE;
- } else if (flags & HAS_16) {
- if (mode == AUMODE_PLAY)
- swcode = mulaw_to_slinear16_le;
- else
- swcode = slinear16_to_mulaw_le;
- factor = 2;
- enc = AUDIO_ENCODING_SLINEAR_LE;
- precision = 16;
} else
return (EINVAL);
break;