Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Convert double block size of data though the play ba...
details: https://anonhg.NetBSD.org/src/rev/2c08e92854f4
branches: trunk
changeset: 828495:2c08e92854f4
user: nat <nat%NetBSD.org@localhost>
date: Sat Dec 16 16:04:20 2017 +0000
description:
Convert double block size of data though the play back filters. This is
primarily for when audio mixing is disabled to stop inserting silence when
there is data available.
This change should have no effect when mixing is enabled as there is only
1 block of data in the mix ring.
diffstat:
sys/dev/audio.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diffs (47 lines):
diff -r 19a42eeb9851 -r 2c08e92854f4 sys/dev/audio.c
--- a/sys/dev/audio.c Sat Dec 16 15:58:56 2017 +0000
+++ b/sys/dev/audio.c Sat Dec 16 16:04:20 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.444 2017/12/16 15:58:56 nat Exp $ */
+/* $NetBSD: audio.c,v 1.445 2017/12/16 16:04:20 nat Exp $ */
/*-
* Copyright (c) 2016 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.444 2017/12/16 15:58:56 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.445 2017/12/16 16:04:20 nat Exp $");
#ifdef _KERNEL_OPT
#include "audio.h"
@@ -2994,7 +2994,10 @@
filter = vc->sc_pfilters[0];
filter->set_fetcher(filter, &ufetcher.base);
fetcher = &vc->sc_pfilters[vc->sc_npfilters - 1]->base;
- cc = sc->sc_mixring.sc_mpr.blksize * 2;
+ if (sc->sc_usemixer)
+ cc = sc->sc_mixring.sc_mpr.blksize * 2;
+ else
+ cc = vc->sc_mpr.blksize * 2;
error = fetcher->fetch_to(sc, fetcher, &stream, cc);
if (error != 0) {
fetcher = &ufetcher.base;
@@ -5535,12 +5538,14 @@
sc->sc_mixring.sc_mpr.blksize);
}
- if (vc->sc_npfilters > 0) {
+ if (vc->sc_npfilters > 0 &&
+ (sc->sc_usemixer || sc->sc_trigger_started)) {
null_fetcher.fetch_to = null_fetcher_fetch_to;
filter = vc->sc_pfilters[0];
filter->set_fetcher(filter, &null_fetcher);
fetcher = &vc->sc_pfilters[vc->sc_npfilters - 1]->base;
- fetcher->fetch_to(sc, fetcher, &vc->sc_mpr.s, vc->sc_mpr.blksize);
+ fetcher->fetch_to(sc, fetcher, &vc->sc_mpr.s,
+ vc->sc_mpr.blksize * 2);
}
if (sc->hw_if->trigger_output && sc->sc_trigger_started == false) {
Home |
Main Index |
Thread Index |
Old Index