diff --git a/src/channel.cpp b/src/channel.cpp index 5c843a59..a940b564 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -96,7 +96,7 @@ bool CChannelSet::PutData ( const CVector& vecbyRecBuf, const int iNumBytesRead, const CHostAddress& HostAdr ) { - bool bChanOK = true; + bool bChanOK = false; Mutex.lock (); { @@ -115,7 +115,7 @@ bool CChannelSet::PutData ( const CVector& vecbyRecBuf, } else { - bChanOK = false; /* no free channel available */ + /* no free channel available */ } } @@ -128,10 +128,12 @@ bool CChannelSet::PutData ( const CVector& vecbyRecBuf, { case PS_AUDIO_OK: PostWinMessage ( MS_JIT_BUF_PUT, MUL_COL_LED_GREEN, iCurChanID ); + bChanOK = true; // in case we have an audio packet, return true break; case PS_AUDIO_ERR: PostWinMessage ( MS_JIT_BUF_PUT, MUL_COL_LED_RED, iCurChanID ); + bChanOK = true; // in case we have an audio packet, return true break; case PS_PROT_ERR: @@ -142,7 +144,7 @@ bool CChannelSet::PutData ( const CVector& vecbyRecBuf, } Mutex.unlock (); - return !bChanOK; /* return 1 if error */ + return bChanOK; } void CChannelSet::GetBlockAllConC ( CVector& vecChanID, diff --git a/src/socket.cpp b/src/socket.cpp index f4e4aabe..8c1cdc09 100755 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -124,11 +124,13 @@ void CSocket::OnDataReceived () else { /* server */ - // a packet was received, tell the server object to wake up if it - // is in sleep mode (Qt will delete the event object when done) - QThread::postEvent ( pServer, - new CLlconEvent ( MS_PACKET_RECEIVED, 0, 0 ) ); - - pChannelSet->PutData ( vecbyRecBuf, iNumBytesRead, RecHostAddr ); + if ( pChannelSet->PutData ( vecbyRecBuf, iNumBytesRead, RecHostAddr ) ) + { + // this was an audio packet, start server + // tell the server object to wake up if it + // is in sleep mode (Qt will delete the event object when done) + QThread::postEvent ( pServer, + new CLlconEvent ( MS_PACKET_RECEIVED, 0, 0 ) ); + } } }