From d7be0781cc3b92a8b84d81c8c60a0e2e9e388574 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 22 Jan 2004 23:08:25 +0000 Subject: [PATCH] don't FillBuf in the main thread --- stepmania/src/RageSound.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index 50290ce461..cdd0f18ba2 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -224,13 +224,18 @@ void RageSound::SetLengthSeconds(float secs) } /* Read data at the rate we're playing it. We only do this to smooth out the rate - * we read data; the sound thread will always read more if it's needed. */ + * we read data; the sound thread will always read more if it's needed. + * + * Actually, this isn't a good idea. The sound driver will read in small chunks, + * interleaving between files. For example, if four files are playing, and each + * is two chunks behind, it'll read a chunk from each file twice, instead of reading + * two chunks for each file at a time, which reduces the chance of underrun. */ void RageSound::Update(float delta) { - LockMut(SOUNDMAN->lock); +// LockMut(SOUNDMAN->lock); - if( playing && delta ) - FillBuf(int(delta * GetSampleRate() * samplesize)); +// if( playing && delta ) +// FillBuf(int(delta * GetSampleRate() * samplesize)); } /* Return the number of bytes available in the input buffer. */