From 2accf47cf35d45e4f2e6361783e76fb23d405696 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 7 Sep 2004 22:57:53 +0000 Subject: [PATCH] fix false "underruns" --- stepmania/src/arch/Sound/DSoundHelpers.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stepmania/src/arch/Sound/DSoundHelpers.cpp b/stepmania/src/arch/Sound/DSoundHelpers.cpp index 87189306f0..1c6f32b319 100644 --- a/stepmania/src/arch/Sound/DSoundHelpers.cpp +++ b/stepmania/src/arch/Sound/DSoundHelpers.cpp @@ -356,6 +356,10 @@ void DSoundBuf::CheckUnderrun( int cursorstart, int cursorend, int chunksize ) if( buffer_bytes_filled >= buffersize ) return; + /* If nothing is expected to be filled, we can't underrun. */ + if( cursorstart == cursorend ) + return; + /* If there's no data in the buffer at all, then we've completely underrun. Our * write cursor is irrelevant; we might be unrelated to the play position completely. * Realign. */