Module Name:    src
Committed By:   nat
Date:           Sun May 28 21:12:59 UTC 2017

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

Log Message:
The scope of setting the gain for playback or recording is now limited to
operating on the volume of its virtual channel.


To generate a diff of this commit:
cvs rdiff -u -r1.353 -r1.354 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.353 src/sys/dev/audio.c:1.354
--- src/sys/dev/audio.c:1.353	Sat May 27 13:55:58 2017
+++ src/sys/dev/audio.c	Sun May 28 21:12:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.353 2017/05/27 13:55:58 nat Exp $	*/
+/*	$NetBSD: audio.c,v 1.354 2017/05/28 21:12:59 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.353 2017/05/27 13:55:58 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.354 2017/05/28 21:12:59 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -4734,18 +4734,11 @@ audiosetinfo(struct audio_softc *sc, str
 		if (error)
 			goto cleanup;
 	}
-	if (SPECIFIED(p->gain)) {
-		au_get_gain(sc, &sc->sc_outports, &gain, &balance);
-		error = au_set_gain(sc, &sc->sc_outports, p->gain, balance);
-		if (error)
-			goto cleanup;
-	}
-	if (SPECIFIED(r->gain)) {
-		au_get_gain(sc, &sc->sc_inports, &gain, &balance);
-		error = au_set_gain(sc, &sc->sc_inports, r->gain, balance);
-		if (error)
-			goto cleanup;
-	}
+	if (SPECIFIED(p->gain))
+		vc->sc_swvol = p->gain;
+
+	if (SPECIFIED(r->gain))
+		vc->sc_recswvol = r->gain;
 
 	if (SPECIFIED_CH(p->balance)) {
 		au_get_gain(sc, &sc->sc_outports, &gain, &balance);

Reply via email to