simplify
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user