aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/sound/lwjgl/Channel.java
diff options
context:
space:
mode:
authorCarsten Weisse <[email protected]>2005-12-04 20:56:26 +0000
committerCarsten Weisse <[email protected]>2005-12-04 20:56:26 +0000
commit8878d362d774a1ac1be66ee20a753132b1c0ebe2 (patch)
tree0a1282c1b7a8ac2143fa23b544b2a5b36d8ca84c /src/jake2/sound/lwjgl/Channel.java
parentee4966164662c9d95d067c0635cae2c5c39e59d8 (diff)
avoid stream queue overrun
Diffstat (limited to 'src/jake2/sound/lwjgl/Channel.java')
-rw-r--r--src/jake2/sound/lwjgl/Channel.java4
1 files changed, 3 insertions, 1 deletions
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 {