Module Name: src Committed By: snj Date: Fri Jun 30 06:34:20 UTC 2017
Modified Files: src/sys/dev [netbsd-8]: aurateconv.c Log Message: Pull up following revision(s) (requested by nat in ticket #69): sys/dev/aurateconv.c: revision 1.20 Rate conversion works at 8 bits, so enable it. Ok christos@. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.19.42.1 src/sys/dev/aurateconv.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/aurateconv.c diff -u src/sys/dev/aurateconv.c:1.19 src/sys/dev/aurateconv.c:1.19.42.1 --- src/sys/dev/aurateconv.c:1.19 Wed Nov 23 23:07:31 2011 +++ src/sys/dev/aurateconv.c Fri Jun 30 06:34:20 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: aurateconv.c,v 1.19 2011/11/23 23:07:31 jmcneill Exp $ */ +/* $NetBSD: aurateconv.c,v 1.19.42.1 2017/06/30 06:34:20 snj Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: aurateconv.c,v 1.19 2011/11/23 23:07:31 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aurateconv.c,v 1.19.42.1 2017/06/30 06:34:20 snj Exp $"); #include <sys/systm.h> #include <sys/types.h> @@ -68,6 +68,8 @@ typedef struct aurateconv { static int aurateconv_fetch_to(struct audio_softc *, stream_fetcher_t *, audio_stream_t *, int); static void aurateconv_dtor(stream_filter_t *); +static int aurateconv_slinear8_LE(aurateconv_t *, audio_stream_t *, + int, int, int); static int aurateconv_slinear16_LE(aurateconv_t *, audio_stream_t *, int, int, int); static int aurateconv_slinear24_LE(aurateconv_t *, audio_stream_t *, @@ -118,8 +120,9 @@ aurateconv(struct audio_softc *sc, const } if ((from->encoding != AUDIO_ENCODING_SLINEAR_LE && from->encoding != AUDIO_ENCODING_SLINEAR_BE) - || (from->precision != 16 && from->precision != 24 && from->precision != 32)) { - printf("%s: encoding/precision must be SLINEAR_LE 16/24/32bit, " + || (from->precision != 8 && from->precision != 16 && + from->precision != 24 && from->precision != 32)) { + printf("%s: encoding/precision must be SLINEAR_LE 8/16/24/32bit, " "or SLINEAR_BE 16/24/32bit", __func__); return NULL; } @@ -189,6 +192,9 @@ aurateconv_fetch_to(struct audio_softc * switch (this->from.encoding) { case AUDIO_ENCODING_SLINEAR_LE: switch (this->from.precision) { + case 8: + return aurateconv_slinear8_LE(this, dst, m, + frame_src, frame_dst); case 16: return aurateconv_slinear16_LE(this, dst, m, frame_src, frame_dst); @@ -458,6 +464,7 @@ aurateconv_slinear32_##EN (aurateconv_t return 0; \ } +AURATECONV_SLINEAR(8, LE) AURATECONV_SLINEAR(16, LE) AURATECONV_SLINEAR(24, LE) AURATECONV_SLINEAR32(LE)