cleanup
This commit is contained in:
@@ -323,8 +323,8 @@ bool RageSound::FillBuf( int iFrames )
|
|||||||
|
|
||||||
/* Read in blocks that are a multiple of a sample, the number of
|
/* Read in blocks that are a multiple of a sample, the number of
|
||||||
* channels and the number of input samples. */
|
* channels and the number of input samples. */
|
||||||
int block_size = sizeof(int16_t) * channels * m_Param.speed_input_samples;
|
int iBlockSize = sizeof(int16_t) * channels * m_Param.speed_input_samples;
|
||||||
iReadSize = (iReadSize / block_size) * block_size;
|
iReadSize = (iReadSize / iBlockSize) * iBlockSize;
|
||||||
ASSERT(iReadSize < sizeof(inbuf));
|
ASSERT(iReadSize < sizeof(inbuf));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -438,14 +438,14 @@ bool RageSound::GetDataToPlay( int16_t *pBuffer, int iSize, int &iSoundFrame, in
|
|||||||
* silence for m_LengthSeconds. */
|
* silence for m_LengthSeconds. */
|
||||||
if( !iGotFrames && m_Param.m_LengthSeconds != -1 )
|
if( !iGotFrames && m_Param.m_LengthSeconds != -1 )
|
||||||
{
|
{
|
||||||
const float LastSecond = m_Param.m_StartSecond + m_Param.m_LengthSeconds;
|
const float fLastSecond = m_Param.m_StartSecond + m_Param.m_LengthSeconds;
|
||||||
int LastFrame = int(LastSecond*samplerate());
|
int iLastFrame = int(fLastSecond*samplerate());
|
||||||
int FramesOfSilence = LastFrame - m_iDecodePosition;
|
int iFramesOfSilence = iLastFrame - m_iDecodePosition;
|
||||||
FramesOfSilence = clamp( FramesOfSilence, 0, iSize );
|
iFramesOfSilence = clamp( iFramesOfSilence, 0, iSize );
|
||||||
if( FramesOfSilence > 0 )
|
if( iFramesOfSilence > 0 )
|
||||||
{
|
{
|
||||||
memset( pBuffer, 0, FramesOfSilence * framesize );
|
memset( pBuffer, 0, iFramesOfSilence * framesize );
|
||||||
iGotFrames = FramesOfSilence;
|
iGotFrames = iFramesOfSilence;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user