prevent possible WAV read hang (thanks to Steve Checkoway)

This commit is contained in:
Flameshadowxeroshin
2011-03-20 21:42:57 -05:00
parent 7d8e2c33bc
commit 226cb92aac
+1 -1
View File
@@ -374,7 +374,7 @@ public:
int iFramesToCopy = (m_iBufferAvail-m_iBufferUsed) / iBytesPerFrame;
iFramesToCopy = min( iFramesToCopy, (int) (iFrames-iGotFrames) );
int iSamplesToCopy = iFramesToCopy * iSamplesPerFrame;
int iBytesToCopy = iSamplesToCopy * sizeof(int16_t);
int iBytesToCopy = iSamplesToCopy * sizeof(float);
memcpy( buf, m_pBuffer+m_iBufferUsed, iBytesToCopy );
m_iBufferUsed += iBytesToCopy;
iGotFrames += iFramesToCopy;