From b115a685d9895accc90fe6bd63c4bd6a5b6fca97 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 6 Jun 2004 05:02:39 +0000 Subject: [PATCH] only count g_TotalAhead when we're ahead --- .../src/arch/Sound/RageSoundDriver_Generic_Software.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp b/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp index 0123221e3a..bb6d0f9655 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp @@ -45,8 +45,11 @@ void RageSound_Generic_Software::Mix( int16_t *buf, int frames, int64_t frameno, { RAGE_ASSERT_M( m_DecodeThread.IsCreated(), "RageSound_Generic_Software::StartDecodeThread() was never called" ); - g_TotalAhead += (int) (frameno - current_frameno + frames); - ++g_TotalAheadCount; + if( frameno - current_frameno + frames > 0 ) + { + g_TotalAhead += (int) (frameno - current_frameno + frames); + ++g_TotalAheadCount; + } static SoundMixBuffer mix;