Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb uaudio_set_params() for mulaw:



details:   https://anonhg.NetBSD.org/src/rev/11d27668ee7c
branches:  trunk
changeset: 522264:11d27668ee7c
user:      kent <kent%NetBSD.org@localhost>
date:      Thu Feb 14 12:55:51 2002 +0000

description:
uaudio_set_params() for mulaw:
Give priority to 16bit again in the case the device has no hardware
support for mulaw.

diffstat:

 sys/dev/usb/uaudio.c |  22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diffs (50 lines):

diff -r 8966c4b09bce -r 11d27668ee7c sys/dev/usb/uaudio.c
--- a/sys/dev/usb/uaudio.c      Thu Feb 14 12:52:01 2002 +0000
+++ b/sys/dev/usb/uaudio.c      Thu Feb 14 12:55:51 2002 +0000
@@ -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 @@
                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 @@
                                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;



Home | Main Index | Thread Index | Old Index