From: havoc Date: Fri, 21 Jul 2006 07:16:18 +0000 (+0000) Subject: reverting DirectSound buffer position wrapping code to something similar to the old... X-Git-Tag: xonotic-v0.1.0preview~3862 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=11412bd9b37cead3418715820ef25530b6b2db1e;p=xonotic%2Fdarkplaces.git reverting DirectSound buffer position wrapping code to something similar to the old code (except using % instead of &) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6518 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_win.c b/snd_win.c index 502468a4..6b022505 100644 --- a/snd_win.c +++ b/snd_win.c @@ -703,10 +703,7 @@ unsigned int SndSys_GetSoundTime (void) unsigned int diff; IDirectSoundBuffer_GetCurrentPosition(pDSBuf, &dwTime, NULL); - if (dwTime > dwStartTime) - diff = dwTime - dwStartTime; - else - diff = gSndBufSize - dwStartTime + dwTime; + diff = (unsigned int)(dwTime - dwStartTime) % (unsigned int)gSndBufSize; dwStartTime = dwTime; dsound_time += diff / factor;