From 32b39d57308567a35323f4e3573ea8129d2ac0dc Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 25 Feb 2004 00:14:30 +0000 Subject: [PATCH] underrun detection fix --- stepmania/src/arch/Sound/DSoundHelpers.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/stepmania/src/arch/Sound/DSoundHelpers.cpp b/stepmania/src/arch/Sound/DSoundHelpers.cpp index 036b833ec0..da5407a9e0 100644 --- a/stepmania/src/arch/Sound/DSoundHelpers.cpp +++ b/stepmania/src/arch/Sound/DSoundHelpers.cpp @@ -347,7 +347,7 @@ bool DSoundBuf::get_output_buf(char **buffer, unsigned *bufsiz, int chunksize) /* We're already underrunning, which means the play cursor has passed valid * data. Let's move the cursor forward. */ - if( buffer_bytes_filled < writeahead && + if( buffer_bytes_filled < buffersize && (!contained(first_byte_filled, write_cursor, cursorstart) || !contained(first_byte_filled, write_cursor, cursorend)) ) { @@ -365,9 +365,6 @@ bool DSoundBuf::get_output_buf(char **buffer, unsigned *bufsiz, int chunksize) buffer_bytes_filled = no_write_zone_size; write_cursor = cursorend; - - /* Don't register another buffer underrun until the play cursor - * passes the new write cursor. */ } }