Module Name:    src
Committed By:   nat
Date:           Sat Dec 16 15:56:00 UTC 2017

Modified Files:
        src/sys/dev: audio.c

Log Message:
Only init the mix ring if sc_usemixer is enabled as with mixing set to
false the mix ring is not used.


To generate a diff of this commit:
cvs rdiff -u -r1.442 -r1.443 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.442 src/sys/dev/audio.c:1.443
--- src/sys/dev/audio.c:1.442	Thu Nov 30 20:25:54 2017
+++ src/sys/dev/audio.c	Sat Dec 16 15:56:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.442 2017/11/30 20:25:54 christos Exp $	*/
+/*	$NetBSD: audio.c,v 1.443 2017/12/16 15:56:00 nat Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss <nathanialsl...@yahoo.com.au>
@@ -148,7 +148,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.442 2017/11/30 20:25:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.443 2017/12/16 15:56:00 nat Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -2223,10 +2223,10 @@ audio_open(dev_t dev, struct audio_softc
 			}
 		}
 		audio_initbufs(sc, NULL);
-		if (audio_can_playback(sc))
+		if (sc->sc_usemixer && audio_can_playback(sc))
 			audio_init_ringbuffer(sc, &sc->sc_mixring.sc_mpr,
 			    AUMODE_PLAY);
-		if (audio_can_capture(sc))
+		if (sc->sc_usemixer && audio_can_capture(sc))
 			audio_init_ringbuffer(sc, &sc->sc_mixring.sc_mrr,
 			    AUMODE_RECORD);
 		sc->schedule_wih = false;

Reply via email to