From 46ffcfbf95feffee1a6b2ec7230a4b84e117c299 Mon Sep 17 00:00:00 2001 From: kent Date: Thu, 14 Feb 2002 12:55:51 +0000 Subject: [PATCH] uaudio_set_params() for mulaw: Give priority to 16bit again in the case the device has no hardware support for mulaw. --- sys/dev/usb/uaudio.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c index 2ed294e2e88e..6f50ea24ae02 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 -__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 #include @@ -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;