From 11412bd9b37cead3418715820ef25530b6b2db1e Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 21 Jul 2006 07:16:18 +0000 Subject: [PATCH] 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 --- snd_win.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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; -- 2.39.2