From: havoc Date: Sat, 8 Mar 2008 20:24:58 +0000 (+0000) Subject: fix MMSYSERRR_STILLPLAYING handling to not increment snd_sent X-Git-Tag: xonotic-v0.1.0preview~2327 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=99b0975118f01d84caf24769b8040e5eb44e72a1;p=xonotic%2Fdarkplaces.git 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 --- 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;