Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Use mix ring block size in audio write, startp, and ...
details: https://anonhg.NetBSD.org/src/rev/1cb60ab8416c
branches: trunk
changeset: 357251:1cb60ab8416c
user: nat <nat%NetBSD.org@localhost>
date: Fri Nov 03 05:04:17 2017 +0000
description:
Use mix ring block size in audio write, startp, and audio drain.
diffstat:
sys/dev/audio.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diffs (60 lines):
diff -r 6093064de504 -r 1cb60ab8416c sys/dev/audio.c
--- a/sys/dev/audio.c Thu Nov 02 19:39:33 2017 +0000
+++ b/sys/dev/audio.c Fri Nov 03 05:04:17 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.422 2017/11/02 02:08:02 nat Exp $ */
+/* $NetBSD: audio.c,v 1.423 2017/11/03 05:04:17 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.422 2017/11/02 02:08:02 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.423 2017/11/03 05:04:17 nat Exp $");
#ifdef _KERNEL_OPT
#include "audio.h"
@@ -2360,8 +2360,9 @@
* block was too short. Pad it and start now.
*/
uint8_t *inp = cb->s.inp;
-
- cc = cb->blksize - (inp - cb->s.start) % cb->blksize;
+ int blksize = sc->sc_mixring.sc_mpr.blksize;
+
+ cc = blksize - (inp - cb->s.start) % blksize;
audio_fill_silence(&cb->s.param, inp, cc);
cb->s.inp = audio_stream_add_inp(&cb->s, inp, cc);
mutex_exit(sc->sc_intr_lock);
@@ -2400,9 +2401,9 @@
#endif
vc->sc_draining = true;
- drops = cb->drops;
+ drops = cb->drops + (cb->blksize * PREFILL_BLOCKS);
error = 0;
- while (cb->drops == drops && !error) {
+ while (cb->drops < drops && !error) {
DPRINTF(("audio_drain: vc=%p used=%d, drops=%ld\n",
vc,
audio_stream_get_used(&vc->sc_mpr.s),
@@ -2941,7 +2942,7 @@
filter = vc->sc_pfilters[0];
filter->set_fetcher(filter, &ufetcher.base);
fetcher = &vc->sc_pfilters[vc->sc_npfilters - 1]->base;
- cc = cb->blksize * 2;
+ cc = sc->sc_mixring.sc_mpr.blksize * 2;
error = fetcher->fetch_to(sc, fetcher, &stream, cc);
if (error != 0) {
fetcher = &ufetcher.base;
@@ -3525,7 +3526,7 @@
if (vc == sc->sc_hwvc)
return 0;
- if (!vc->sc_mpr.mmapped && used < vc->sc_mpr.blksize) {
+ if (!vc->sc_mpr.mmapped && used < sc->sc_mixring.sc_mpr.blksize) {
cv_broadcast(&sc->sc_wchan);
DPRINTF(("%s: wakeup and return\n", __func__));
return 0;
Home |
Main Index |
Thread Index |
Old Index