From 5052ec6f1444a527f08df5c452a872d6224a8c9a Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Fri, 31 Jul 2009 18:53:40 +0000 Subject: [PATCH] bug fix --- src/buffer.cpp | 6 ++---- src/buffer.h | 2 +- src/channel.cpp | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) 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; }