Source-Changes-HG archive

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

[src/trunk]: src/sys/dev When a recording interrupt happened in the middle of...



details:   https://anonhg.NetBSD.org/src/rev/3ba8fd8425bc
branches:  trunk
changeset: 533828:3ba8fd8425bc
user:      gson <gson%NetBSD.org@localhost>
date:      Wed Jul 10 02:25:49 2002 +0000

description:
When a recording interrupt happened in the middle of audio_read(),
changes to cb->used by audio_rint() could be overwritten by audio_read().

diffstat:

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

diffs (33 lines):

diff -r a3c71e210efb -r 3ba8fd8425bc sys/dev/audio.c
--- a/sys/dev/audio.c   Wed Jul 10 02:05:25 2002 +0000
+++ b/sys/dev/audio.c   Wed Jul 10 02:25:49 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.158 2002/06/23 01:36:07 gmcgarry Exp $     */
+/*     $NetBSD: audio.c,v 1.159 2002/07/10 02:25:49 gson Exp $ */
 
 /*
  * Copyright (c) 1991-1993 Regents of the University of California.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.158 2002/06/23 01:36:07 gmcgarry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.159 2002/07/10 02:25:49 gson Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -1263,13 +1263,12 @@
                         * The format of data in sc_rconvbuffer is
                         * [sample_rate, hw_encoding, hw_precision, channels]
                         */
-                       used -= cc;
                        outp += cc;
                        if (outp >= cb->end)
                                outp -= cb->end - cb->start;
                        s = splaudio();
                        cb->outp = outp;
-                       cb->used = used;
+                       cb->used -= cc;
                        cb->copying = 0;
                        splx(s);
 



Home | Main Index | Thread Index | Old Index