From 327c0352d20fe59636ef60a2ef5a47838402d222 Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Tue, 10 Mar 2009 20:29:15 +0000 Subject: [PATCH] =?UTF-8?q?Einen=20=C3=BCblen=20Soundcrash=20entfernt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/sound/snd_dma.c | 7 +++++++ src/client/sound/snd_mix.c | 4 ++++ src/common/qcommon.h | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/client/sound/snd_dma.c b/src/client/sound/snd_dma.c index ccd313d0..ba0c91a0 100644 --- a/src/client/sound/snd_dma.c +++ b/src/client/sound/snd_dma.c @@ -116,6 +116,7 @@ S_Init void S_Init (void) { cvar_t *cv; + s_pendingplays.next = NULL; Com_Printf("\n------- sound initialization -------\n"); @@ -716,6 +717,12 @@ void S_StartSound(vec3_t origin, int entnum, int entchannel, sfx_t *sfx, float f else ps->begin = (int)(start + timeofs * dma.speed); + if(s_pendingplays.next == NULL) + { + s_pendingplays = *ps; + return; + } + // sort into the pending sound list for (sort = s_pendingplays.next ; sort != &s_pendingplays && sort->begin < ps->begin ; diff --git a/src/client/sound/snd_mix.c b/src/client/sound/snd_mix.c index 2aaacf14..8f11f230 100644 --- a/src/client/sound/snd_mix.c +++ b/src/client/sound/snd_mix.c @@ -199,6 +199,10 @@ void S_PaintChannels(int endtime) while (1) { ps = s_pendingplays.next; + + if (ps == NULL) + break; + if (ps == &s_pendingplays) break; // no more pending sounds if (ps->begin <= paintedtime) diff --git a/src/common/qcommon.h b/src/common/qcommon.h index 4d66337a..10ceba59 100644 --- a/src/common/qcommon.h +++ b/src/common/qcommon.h @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "../game/quake2/q_shared.h" -#define VERSION 1.02 +#define VERSION 1.03 #define BASEDIRNAME "baseq2" #if defined __linux__