Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Set hw parameters for linear to ulaw filters.
details: https://anonhg.NetBSD.org/src/rev/4dce764b83d9
branches: trunk
changeset: 824979:4dce764b83d9
user: nat <nat%NetBSD.org@localhost>
date: Sun Jun 25 09:40:17 2017 +0000
description:
Set hw parameters for linear to ulaw filters.
Tested by flxd@.
diffstat:
sys/dev/ic/am7930.c | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diffs (51 lines):
diff -r 08e742cd4180 -r 4dce764b83d9 sys/dev/ic/am7930.c
--- a/sys/dev/ic/am7930.c Sun Jun 25 06:26:40 2017 +0000
+++ b/sys/dev/ic/am7930.c Sun Jun 25 09:40:17 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: am7930.c,v 1.54 2017/06/25 02:09:47 nat Exp $ */
+/* $NetBSD: am7930.c,v 1.55 2017/06/25 09:40:17 nat Exp $ */
/*
* Copyright (c) 1995 Rolf Grossmann
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: am7930.c,v 1.54 2017/06/25 02:09:47 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: am7930.c,v 1.55 2017/06/25 09:40:17 nat Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -242,6 +242,12 @@
hw.precision *= sc->sc_glue->factor;
pfil->append(pfil, sc->sc_glue->output_conv, &hw);
}
+ if (p->encoding == AUDIO_ENCODING_SLINEAR) {
+ hw = *p;
+ hw.encoding = AUDIO_ENCODING_ULAW;
+ pfil->append(pfil, linear8_to_mulaw, &hw);
+ }
+
}
if ((usemode & AUMODE_RECORD) == AUMODE_RECORD) {
if (r->sample_rate < 7500 || r->sample_rate > 8500 ||
@@ -257,14 +263,11 @@
hw.precision *= sc->sc_glue->factor;
pfil->append(rfil, sc->sc_glue->input_conv, &hw);
}
- }
-
- if (p->encoding == AUDIO_ENCODING_SLINEAR ||
- r->encoding == AUDIO_ENCODING_SLINEAR) {
- hw.encoding = AUDIO_ENCODING_ULAW;
- pfil->req_size = rfil->req_size = 0;
- rfil->append(rfil, mulaw_to_linear8, &hw);
- pfil->append(pfil, linear8_to_mulaw, &hw);
+ if (r->encoding == AUDIO_ENCODING_SLINEAR) {
+ hw = *r;
+ hw.encoding = AUDIO_ENCODING_ULAW;
+ rfil->append(rfil, mulaw_to_linear8, &hw);
+ }
}
return 0;
Home |
Main Index |
Thread Index |
Old Index