aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/jake2/sound/joal/Channel.java4
-rw-r--r--src/jake2/sound/lwjgl/Channel.java4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/jake2/sound/joal/Channel.java b/src/jake2/sound/joal/Channel.java
index 8a26587..20d9d83 100644
--- a/src/jake2/sound/joal/Channel.java
+++ b/src/jake2/sound/joal/Channel.java
@@ -3,7 +3,7 @@
*
* Copyright (C) 2003
*
- * $Id: Channel.java,v 1.5 2005-12-04 17:28:48 cawe Exp $
+ * $Id: Channel.java,v 1.6 2005-12-04 20:56:26 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -202,6 +202,8 @@ public class Channel {
buffer[0] = buffers[Sound.MAX_SFX + streamQueue++];
Com.DPrintf("queue " + (streamQueue - 1) + '\n');
} else if (processed < 2) {
+ // check queue overrun
+ if (streamQueue >= Sound.STREAM_QUEUE) return;
buffer[0] = buffers[Sound.MAX_SFX + streamQueue++];
Com.DPrintf("queue " + (streamQueue - 1) + '\n');
} else {
diff --git a/src/jake2/sound/lwjgl/Channel.java b/src/jake2/sound/lwjgl/Channel.java
index 8601aec..c4ab42d 100644
--- a/src/jake2/sound/lwjgl/Channel.java
+++ b/src/jake2/sound/lwjgl/Channel.java
@@ -3,7 +3,7 @@
*
* Copyright (C) 2003
*
- * $Id: Channel.java,v 1.7 2005-12-04 17:27:34 cawe Exp $
+ * $Id: Channel.java,v 1.8 2005-12-04 20:56:26 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -204,6 +204,8 @@ public class Channel {
buffer.put(0, buffers.get(Sound.MAX_SFX + streamQueue++));
Com.DPrintf("queue " + (streamQueue - 1) + '\n');
} else if (processed < 2) {
+ // check queue overrun
+ if (streamQueue >= Sound.STREAM_QUEUE) return;
buffer.put(0, buffers.get(Sound.MAX_SFX + streamQueue++));
Com.DPrintf("queue " + (streamQueue - 1) + '\n');
} else {