From bf40f3aa98227da16c434e0b56652e7d5e3e10d2 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 26 Jan 2007 09:28:00 +0000 Subject: [PATCH] fix buffer alignment; caused static in mono sounds --- stepmania/src/RageSound.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index a2a7ac9add..e4e20d2e08 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -37,8 +37,6 @@ #include "RageSoundReader_FileReader.h" #include "RageSoundReader_ThreadedBuffer.h" -static const int channels = 2; -static const int framesize = 2 * channels; /* 16-bit */ #define samplerate() m_pSource->GetSampleRate() RageSoundParams::RageSoundParams(): @@ -289,7 +287,7 @@ int RageSound::GetDataToPlay( int16_t *pBuffer, int iFrames, int64_t &iStreamFra int iSourceFrame; /* Read data from our source. */ - int iGotFrames = m_pSource->RetriedRead( pBuffer + (iFramesStored * channels), iFrames, &iSourceFrame, &fRate ); + int iGotFrames = m_pSource->RetriedRead( pBuffer + (iFramesStored * m_pSource->GetNumChannels()), iFrames, &iSourceFrame, &fRate ); if( iGotFrames == RageSoundReader::ERROR ) {