Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev The scope of setting the gain for playback or record...



details:   https://anonhg.NetBSD.org/src/rev/76ba5b3f0279
branches:  trunk
changeset: 824231:76ba5b3f0279
user:      nat <nat%NetBSD.org@localhost>
date:      Sun May 28 21:12:59 2017 +0000

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

diffstat:

 sys/dev/audio.c |  21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)

diffs (42 lines):

diff -r b5bd8a0f440a -r 76ba5b3f0279 sys/dev/audio.c
--- a/sys/dev/audio.c   Sun May 28 18:39:58 2017 +0000
+++ b/sys/dev/audio.c   Sun May 28 21:12:59 2017 +0000
@@ -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 <nathanialsloss%yahoo.com.au@localhost>
@@ -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 @@
                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);



Home | Main Index | Thread Index | Old Index