diff --git a/src/channel.cpp b/src/channel.cpp index 52ea1fc7..517bd65b 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -151,10 +151,7 @@ void CChannel::SetAudioStreamProperties ( const int iNewNetwFrameSize, // init conversion buffer ConvBuf.Init ( iNetwFrameSize * iNetwFrameSizeFact ); - // initialize and reset cycle time variance measurement - CycleTimeVariance.Init ( iNetwFrameSizeFact * SYSTEM_FRAME_SIZE_SAMPLES, - SYSTEM_SAMPLE_RATE_HZ, TIME_MOV_AV_RESPONSE_SECONDS ); - + // reset cycle time variance measurement CycleTimeVariance.Reset(); // tell the server that audio coding has changed @@ -641,9 +638,9 @@ void CChannel::UpdateSocketBufferSize ( const double dLocalStdDev ) // TEST //if (bIsServer) { static FILE* pFile = fopen ( "c:\\temp\\test.dat", "w" ); -fprintf ( pFile, "%e %e %e %e\n", CycleTimeVariance.GetStdDev(), dLocalStdDev, dAudioBufferDurationMs, dEstCurBufSet ); +fprintf ( pFile, "%e %e %e\n", CycleTimeVariance.GetStdDev(), dLocalStdDev, dEstCurBufSet ); fflush ( pFile ); -// close;x=read('c:/temp/test.dat',-1,4);plot(x) +// close;x=read('c:/temp/test.dat',-1,3);plot(x) //} */ diff --git a/src/client.cpp b/src/client.cpp index d7e9ca08..c055cc1f 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -595,7 +595,7 @@ void CClient::Init() vecdAudioStereo.Init ( iStereoBlockSizeSam ); // init response time evaluation - CycleTimeVariance.Init ( iMonoBlockSizeSam, + CycleTimeVariance.Init ( SYSTEM_FRAME_SIZE_SAMPLES, SYSTEM_SAMPLE_RATE_HZ, TIME_MOV_AV_RESPONSE_SECONDS ); CycleTimeVariance.Reset(); diff --git a/src/util.h b/src/util.h index 497544f1..d4be259f 100755 --- a/src/util.h +++ b/src/util.h @@ -727,7 +727,7 @@ public: void Init ( const int iNewBlockLengthAtSystemSampleRate, const int iNewSystemSampleRateHz, const int iHistoryLengthTimeSec, - const int iNewNewValueBoundFactor = 10 ) + const int iNewNewValueBoundFactor = MAX_NET_BUF_SIZE_NUM_BL ) { // store block size and new value bound factor iBlockLengthAtSystemSampleRate = iNewBlockLengthAtSystemSampleRate; @@ -760,6 +760,14 @@ public: const double dCurAddVal = static_cast ( CurTime - TimeLastBlock ) - dIntervalTime; +/* +// TEST +static FILE* pFile = fopen ( "c:\\temp\\test.dat", "w" ); +fprintf ( pFile, "%e %e\n", dCurAddVal, iNewValueBoundFactor * dIntervalTime ); +fflush ( pFile ); +// close;x=read('c:/temp/test.dat',-1,2);plot(x) +*/ + if ( iNewValueBoundFactor > 0 ) { // check if new value is in range