]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
reverting DirectSound buffer position wrapping code to something similar to the old...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 21 Jul 2006 07:16:18 +0000 (07:16 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 21 Jul 2006 07:16:18 +0000 (07:16 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6518 d7cf8633-e32d-0410-b094-e92efae38249

snd_win.c

index 502468a42ceb838df9aab54d2dab492105e582dc..6b0225055b9a8fc3a098911cf861b3a723f0aebf 100644 (file)
--- 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;