]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added WAV_BUFFERTIME setting of 0.125 (used to be 0.5)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 8 Mar 2008 22:40:01 +0000 (22:40 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 8 Mar 2008 22:40:01 +0000 (22:40 +0000)
reduced WAV_BUFFERS from 64 to 16

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8201 d7cf8633-e32d-0410-b094-e92efae38249

snd_win.c

index 4206cdaf6efc9cc74a4779d8ba58c801aed5e941..c27b3772043e945bc0802b87bce1f18de3eba88f 100644 (file)
--- a/snd_win.c
+++ b/snd_win.c
@@ -87,9 +87,9 @@ extern HWND mainwindow;
 HRESULT (WINAPI *pDirectSoundCreate)(GUID FAR *lpGUID, LPDIRECTSOUND FAR *lplpDS, IUnknown FAR *pUnkOuter);
 #endif
 
-// Wave output: 64KB in 64 buffers of 1KB
-// (64KB is > 1 sec at 16-bit 22050 Hz mono, and is 1/3 sec at 16-bit 44100 Hz stereo)
-#define        WAV_BUFFERS             64
+// Wave output: how much buffer time, and how many partitions in that time
+#define WAV_BUFFERTIME 0.125
+#define        WAV_BUFFERS             16
 #define        WAV_MASK                (WAV_BUFFERS - 1)
 static unsigned int wav_buffer_size;
 
@@ -458,7 +458,7 @@ static qboolean SndSys_InitMmsystem (const snd_format_t* requested)
                }
        }
 
-       wav_buffer_size = (requested->speed / 2 / WAV_BUFFERS) * requested->channels * requested->width;
+       wav_buffer_size = ((int)(requested->speed * WAV_BUFFERTIME) / WAV_BUFFERS) * requested->channels * requested->width;
 
        /*
         * Allocate and lock memory for the waveform data. The memory