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:
Kyzentun Keeslala
2016-06-21 20:09:16 -06:00
parent d4926506f9
commit 8796946b4f
3 changed files with 5 additions and 4 deletions
+3 -1
View File
@@ -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;
}