From 99b0975118f01d84caf24769b8040e5eb44e72a1 Mon Sep 17 00:00:00 2001 From: havoc Date: Sat, 8 Mar 2008 20:24:58 +0000 Subject: [PATCH] fix MMSYSERRR_STILLPLAYING handling to not increment snd_sent git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8199 d7cf8633-e32d-0410-b094-e92efae38249 --- snd_win.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/snd_win.c b/snd_win.c index 80a70229..91fc4913 100644 --- a/snd_win.c +++ b/snd_win.c @@ -699,27 +699,24 @@ void SndSys_Submit (void) { h = lpWaveHdr + (snd_sent & WAV_MASK); - snd_sent++; /* * Now the data block can be sent to the output device. The * waveOutWrite function returns immediately and waveform * data is sent to the output device in the background. */ wResult = waveOutWrite(hWaveOut, h, sizeof(WAVEHDR)); - - if (wResult != MMSYSERR_NOERROR) + if (wResult == MMSYSERR_NOERROR) + snd_sent++; + else if (wResult == WAVERR_STILLPLAYING) { - if (wResult == WAVERR_STILLPLAYING) - { - if(developer.integer >= 1000) - Con_Print("waveOutWrite failed (too much sound data)\n"); - } - else - { - Con_Printf("waveOutWrite failed, error code %d\n", (int) wResult); - SndSys_Shutdown (); - return; - } + if(developer.integer >= 1000) + Con_Print("waveOutWrite failed (too much sound data)\n"); + } + else + { + Con_Printf("waveOutWrite failed, error code %d\n", (int) wResult); + SndSys_Shutdown (); + return; } paintpot -= wav_buffer_size; -- 2.39.2