This commit is contained in:
Glenn Maynard
2006-12-22 05:51:36 +00:00
parent 3127f812dd
commit 4d6829e7bc
+1 -3
View File
@@ -352,7 +352,6 @@ int RageSoundReader_Chain::Read( char *pBuffer, int iFrames )
/* Read iFrames from each sound. */ /* Read iFrames from each sound. */
int16_t Buffer[2048]; int16_t Buffer[2048];
iFrames = min( iFrames, (int) (ARRAYLEN(Buffer) / m_iChannels) ); iFrames = min( iFrames, (int) (ARRAYLEN(Buffer) / m_iChannels) );
int iMaxFramesRead = 0;
for( unsigned i = 0; i < m_apActiveSounds.size(); ) for( unsigned i = 0; i < m_apActiveSounds.size(); )
{ {
RageSoundReader *pSound = m_apActiveSounds[i]->pSound; RageSoundReader *pSound = m_apActiveSounds[i]->pSound;
@@ -365,13 +364,12 @@ int RageSoundReader_Chain::Read( char *pBuffer, int iFrames )
continue; continue;
} }
iMaxFramesRead = max( iMaxFramesRead, iFramesRead );
mix.write( Buffer, iFramesRead * pSound->GetNumChannels() ); mix.write( Buffer, iFramesRead * pSound->GetNumChannels() );
++i; ++i;
} }
/* Read mixed frames into the output buffer. */ /* Read mixed frames into the output buffer. */
int iMaxFramesRead = mix.size() / m_iChannels;
mix.read( (int16_t *) pBuffer ); mix.read( (int16_t *) pBuffer );
m_iCurrentFrame += iMaxFramesRead; m_iCurrentFrame += iMaxFramesRead;