From 0bc4bae2a6c78e0f9f912c69b9575fc9a40a8cf0 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Tue, 12 Feb 2013 15:34:26 +0000 Subject: [PATCH] reset network transport properties on disconnect of the channel (so that network transport properties must be received for successful decoding) --- src/channel.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/channel.cpp b/src/channel.cpp index 0a8fb4b2..4de885cb 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -30,11 +30,11 @@ CChannel::CChannel ( const bool bNIsServer ) : vecdGains ( MAX_NUM_CHANNELS, (double) 1.0 ), bDoAutoSockBufSize ( true ), bIsEnabled ( false ), - bIsServer ( bNIsServer ), - iNetwFrameSizeFact ( FRAME_SIZE_FACTOR_PREFERRED ), - iNetwFrameSize ( 20 ), // must be > 0 and should be close to a valid size - iNumAudioChannels ( 1 ) // mono + bIsServer ( bNIsServer ) { + // reset network transport properties + ResetNetworkTransportProperties(); + // initial value for connection time out counter, we calculate the total // number of samples here and subtract the number of samples of the block // which we take out of the buffer to be independent of block sizes @@ -440,11 +440,6 @@ EPutDataStat CChannel::PutData ( const CVector& vecbyData, { Mutex.lock(); { - - -// TODO only process data if network properties protocol message has been arrived - - // only process audio if packet has correct size if ( iNumBytes == ( iNetwFrameSize * iNetwFrameSizeFact ) ) { @@ -538,6 +533,9 @@ EGetDataStat CChannel::GetData ( CVector& vecbyData ) eGetStatus = GS_CHAN_NOW_DISCONNECTED; iConTimeOut = 0; // make sure we do not have negative values + // reset network transport properties + ResetNetworkTransportProperties(); + // emit message emit Disconnected(); }