From ab19f4f2ae3a347584d95415b88a77f229d2ab25 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Mon, 27 Feb 2006 20:27:47 +0000 Subject: [PATCH] bug fix with mutexs --- src/channel.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/channel.cpp b/src/channel.cpp index 389bb23b..c5e7defd 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -225,22 +225,12 @@ CChannel::CChannel () void CChannel::SetSockBufSize ( const int iNewBlockSize, const int iNumBlocks ) { - /* this opperation must be done with mutex */ - -qDebug ( "before lock" ); - + /* this opperation must be done with mutex */ Mutex.lock (); SockBuf.Init ( iNewBlockSize, iNumBlocks ); - -qDebug ( "in lock" ); - Mutex.unlock (); - - -qDebug ( "after lock" ); - } void CChannel::OnJittBufSizeChange ( int iNewJitBufSize ) @@ -267,8 +257,6 @@ bool CChannel::PutData ( const CVector& vecbyData, { bool bRet = true; - Mutex.lock (); /* put mutex lock */ - /* only process if packet has correct size */ if ( iNumBytes == iAudComprSize ) { @@ -291,7 +279,11 @@ for (int i = 0; i < BLOCK_SIZE_SAMPLES; i++) vecdResOutData[i] = (double) vecsDecomprAudio[i]; + Mutex.lock (); /* put mutex lock */ + bRet = SockBuf.Put ( vecdResOutData ); + + Mutex.unlock (); /* put mutex unlock */ /* reset time-out counter */ iConTimeOut = CON_TIME_OUT_CNT_MAX; @@ -305,8 +297,6 @@ for (int i = 0; i < BLOCK_SIZE_SAMPLES; i++) bRet = Protocol.ParseMessage ( vecbyData, iNumBytes ); } - Mutex.unlock (); /* put mutex unlock */ - return bRet; }