Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Revert to previous.



details:   https://anonhg.NetBSD.org/src/rev/3864046245dd
branches:  trunk
changeset: 823723:3864046245dd
user:      nat <nat%NetBSD.org@localhost>
date:      Fri May 05 05:46:49 2017 +0000

description:
Revert to previous.

Simplification of copying data from mix ring to hw ring.

diffstat:

 sys/dev/audio.c |  22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diffs (52 lines):

diff -r 86af7501075f -r 3864046245dd sys/dev/audio.c
--- a/sys/dev/audio.c   Fri May 05 00:38:50 2017 +0000
+++ b/sys/dev/audio.c   Fri May 05 05:46:49 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.333 2017/05/05 00:38:50 nat Exp $  */
+/*     $NetBSD: audio.c,v 1.334 2017/05/05 05:46:49 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.333 2017/05/05 00:38:50 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.334 2017/05/05 05:46:49 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -5473,12 +5473,10 @@
                cc = used;
                cc1 = vc->sc_pustream->end - tocopy;
                cc2 = sc->sc_pr.s.end - orig;
-               if (cc2 < cc1)
+               if (cc > cc1)
+                       cc = cc1;
+               if (cc > cc2)
                        cc = cc2;
-               else
-                       cc = cc1;
-               if (cc > used)
-                       cc = used;
                memcpy(tocopy, orig, cc);
                orig += cc;
                tocopy += cc;
@@ -5571,12 +5569,12 @@
                                else if (orig[m] < 0 && tomix[m] < 0)   \
                                        result -= product / MINVAL;     \
                                orig[m] = result;                       \
+                       }                                               \
                                                                        \
-                               if (&orig[m] >= (type *)sc->sc_pr.s.end)\
-                                       orig = (type *)sc->sc_pr.s.start;\
-                               if (&tomix[m] >= (type *)cb->s.end)     \
-                                       tomix = (type *)cb->s.start;    \
-                       }                                               \
+                       if (&orig[m] >= (type *)sc->sc_pr.s.end)        \
+                               orig = (type *)sc->sc_pr.s.start;       \
+                       if (&tomix[m] >= (type *)cb->s.end)             \
+                               tomix = (type *)cb->s.start;            \
                                                                        \
                        resid -= cc;                                    \
                }                                                       \



Home | Main Index | Thread Index | Old Index