diff --git a/src/buffer.cpp b/src/buffer.cpp index 3f8fc3c9..8751c877 100755 --- a/src/buffer.cpp +++ b/src/buffer.cpp @@ -42,7 +42,8 @@ void CNetBuf::Init ( const int iNewBlockSize, const int iNewNumBlocks ) Clear ( CT_GET ); } -bool CNetBuf::Put ( const CVector& vecbyData ) +bool CNetBuf::Put ( const CVector& vecbyData, + const int iInSize ) { #ifdef _DEBUG_ static FILE* pFileBI = fopen("bufferin.dat", "w"); @@ -52,9 +53,6 @@ fflush(pFileBI); bool bPutOK = true; - // get size of data to be added to the buffer - const int iInSize = vecbyData.Size(); - // Check if there is not enough space available -> correct if ( GetAvailSpace() < iInSize ) { diff --git a/src/buffer.h b/src/buffer.h index 30ef17cd..7b6c18fb 100755 --- a/src/buffer.h +++ b/src/buffer.h @@ -39,7 +39,7 @@ public: void Init ( const int iNewBlockSize, const int iNewNumBlocks ); int GetSize() { return iMemSize / iBlockSize; } - bool Put ( const CVector& vecbyData ); + bool Put ( const CVector& vecbyData, const int iInSize ); bool Get ( CVector& vecbyData ); protected: diff --git a/src/channel.cpp b/src/channel.cpp index d4a00680..56e32641 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -354,7 +354,7 @@ EPutDataStat CChannel::PutData ( const CVector& vecbyData, bIsAudioPacket = true; // store new packet in jitter buffer - if ( SockBuf.Put ( vecbyData ) ) + if ( SockBuf.Put ( vecbyData, iNumBytes ) ) { eRet = PS_AUDIO_OK; }