Changed RSR_WAV and RSR_Resample_Good back to using alloca because only gcc/C99 like dynamic arrays. RSR_SpeedChange now uses new/delete in spite of the performance.
This commit is contained in:
@@ -89,10 +89,11 @@ int RageSoundReader_SpeedChange::FillData( int iMaxFrames )
|
||||
if( iBytesToRead <= 0 )
|
||||
return m_iDataBufferAvailFrames;
|
||||
|
||||
float pTempBuffer[iBytesToRead/sizeof(float)];
|
||||
float* pTempBuffer= new float[iBytesToRead/sizeof(float)];
|
||||
int iGotFrames = m_pSource->Read( pTempBuffer, iFramesToRead );
|
||||
if( iGotFrames < 0 )
|
||||
{
|
||||
delete[] pTempBuffer;
|
||||
if( iGotFrames == END_OF_FILE && m_iDataBufferAvailFrames )
|
||||
return m_iDataBufferAvailFrames;
|
||||
return iGotFrames;
|
||||
@@ -114,6 +115,7 @@ int RageSoundReader_SpeedChange::FillData( int iMaxFrames )
|
||||
++pOut;
|
||||
}
|
||||
}
|
||||
delete[] pTempBuffer;
|
||||
|
||||
m_iDataBufferAvailFrames += iGotFrames;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user