Module Name:    src
Committed By:   snj
Date:           Sat Jul  8 16:37:54 UTC 2017

Modified Files:
        src/sys/dev [netbsd-7]: audio.c

Log Message:
Apply patch (requested by nat in ticket #1433):
Fix occasional stuttering that can be caused by ringbuffer overflow.


To generate a diff of this commit:
cvs rdiff -u -r1.263.2.1 -r1.263.2.2 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.263.2.1 src/sys/dev/audio.c:1.263.2.2
--- src/sys/dev/audio.c:1.263.2.1	Sun Nov 23 13:07:05 2014
+++ src/sys/dev/audio.c	Sat Jul  8 16:37:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.263.2.1 2014/11/23 13:07:05 martin Exp $	*/
+/*	$NetBSD: audio.c,v 1.263.2.2 2017/07/08 16:37:54 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -155,7 +155,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.263.2.1 2014/11/23 13:07:05 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.263.2.2 2017/07/08 16:37:54 snj Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -2960,6 +2960,9 @@ audio_pint(void *v)
 		return;
 	}
 
+	if (audio_stream_get_used(&cb->s) > (cb->usedhigh - cb->blksize))
+		goto done;
+
 #ifdef AUDIO_INTR_TIME
 	{
 		struct timeval tv;
@@ -3038,6 +3041,7 @@ audio_pint(void *v)
 	}
 
 	DPRINTFN(5, ("audio_pint: outp=%p cc=%d\n", cb->s.outp, blksize));
+done:
 	if (hw->trigger_output == NULL) {
 		error = hw->start_output(sc->hw_hdl, __UNCONST(cb->s.outp),
 		    blksize, audio_pint, (void *)sc);

Reply via email to