Module Name: src
Committed By: snj
Date: Fri Jun 30 06:51:28 UTC 2017
Modified Files:
src/sys/dev [netbsd-8]: mulaw.c
Log Message:
Pull up following revision(s) (requested by nat in ticket #74):
sys/dev/mulaw.c: 1.31, 1.32
Rectify an error in mulaw/alaw conversion to big endian. The atf audio
test should pass on sparc again.
--
Better solution to mulaw/alaw conversion on big endian systems/sound
devices.
To generate a diff of this commit:
cvs rdiff -u -r1.28.42.1 -r1.28.42.2 src/sys/dev/mulaw.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/mulaw.c
diff -u src/sys/dev/mulaw.c:1.28.42.1 src/sys/dev/mulaw.c:1.28.42.2
--- src/sys/dev/mulaw.c:1.28.42.1 Fri Jun 30 06:38:00 2017
+++ src/sys/dev/mulaw.c Fri Jun 30 06:51:28 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: mulaw.c,v 1.28.42.1 2017/06/30 06:38:00 snj Exp $ */
+/* $NetBSD: mulaw.c,v 1.28.42.2 2017/06/30 06:51:28 snj Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mulaw.c,v 1.28.42.1 2017/06/30 06:38:00 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mulaw.c,v 1.28.42.2 2017/06/30 06:51:28 snj Exp $");
#include <sys/types.h>
#include <sys/systm.h>
@@ -321,7 +321,7 @@ DEFINE_FILTER(mulaw_to_linear##n_prec)
break; \
case AUDIO_ENCODING_ULINEAR_BE: \
FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) { \
- j = hw - 2; \
+ j = 2; \
d[0] = mulawtolin16[s[0]][0]; \
d[1] = mulawtolin16[s[0]][1]; \
while (j < hw) \
@@ -339,7 +339,7 @@ DEFINE_FILTER(mulaw_to_linear##n_prec)
break; \
case AUDIO_ENCODING_SLINEAR_BE: \
FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) { \
- j = hw - 2; \
+ j = 2; \
d[0] = mulawtolin16[s[0]][0] ^ 0x80; \
d[1] = mulawtolin16[s[0]][1]; \
while (j < hw) \
@@ -456,7 +456,7 @@ DEFINE_FILTER(alaw_to_linear##n_prec)
break; \
case AUDIO_ENCODING_ULINEAR_BE: \
FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) { \
- j = hw - 2; \
+ j = 2; \
d[0] = alawtolin16[s[0]][0]; \
d[1] = alawtolin16[s[0]][1]; \
while (j < hw) \
@@ -474,10 +474,10 @@ DEFINE_FILTER(alaw_to_linear##n_prec)
break; \
case AUDIO_ENCODING_SLINEAR_BE: \
FILTER_LOOP_PROLOGUE(this->src, 1, dst, hw, m) { \
- j = hw - 2; \
+ j = 2; \
d[0] = alawtolin16[s[0]][0] ^ 0x80; \
d[1] = alawtolin16[s[0]][1]; \
- while (j < hw) \
+ while (j < hw) \
d[j++] = 0; \
} FILTER_LOOP_EPILOGUE(this->src, dst); \
break; \