Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Don't start playback or recording on the hw ring onl...
details: https://anonhg.NetBSD.org/src/rev/f90dd0594385
branches: trunk
changeset: 354679:f90dd0594385
user: nat <nat%NetBSD.org@localhost>
date: Sun Jun 25 09:42:40 2017 +0000
description:
Don't start playback or recording on the hw ring only stream ring buffers.
diffstat:
sys/dev/audio.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diffs (47 lines):
diff -r 650e28145e51 -r f90dd0594385 sys/dev/audio.c
--- a/sys/dev/audio.c Sun Jun 25 09:40:17 2017 +0000
+++ b/sys/dev/audio.c Sun Jun 25 09:42:40 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.364 2017/06/25 02:47:28 nat Exp $ */
+/* $NetBSD: audio.c,v 1.365 2017/06/25 09:42:40 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.364 2017/06/25 02:47:28 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.365 2017/06/25 09:42:40 nat Exp $");
#ifdef _KERNEL_OPT
#include "audio.h"
@@ -3485,6 +3485,7 @@
audiostartr(struct audio_softc *sc, struct virtual_channel *vc)
{
+ struct audio_chan *chan;
int error;
KASSERT(mutex_owned(sc->sc_lock));
@@ -3493,8 +3494,11 @@
vc->sc_mrr.s.start, audio_stream_get_used(&vc->sc_mrr.s),
vc->sc_mrr.usedhigh, vc->sc_mrr.mmapped));
+ chan = SIMPLEQ_FIRST(&sc->sc_audiochan);
if (!audio_can_capture(sc))
return EINVAL;
+ if (vc == chan->vc)
+ return 0;
error = 0;
if (sc->sc_rec_started == false) {
@@ -3525,6 +3529,8 @@
if (!audio_can_playback(sc))
return EINVAL;
+ if (vc == chan->vc)
+ return 0;
if (!vc->sc_mpr.mmapped && used < vc->sc_mpr.blksize) {
cv_broadcast(&sc->sc_wchan);
Home |
Main Index |
Thread Index |
Old Index