bug fixes

This commit is contained in:
Volker Fischer 2009-03-08 09:01:01 +00:00
parent 40fda55929
commit db19ed48bc
3 changed files with 10 additions and 6 deletions

View file

@ -271,7 +271,9 @@ void CClient::Init ( const int iPrefMonoBlockSizeSamIndexAtSndCrdSamRate )
vecdNetwData.Init ( iMonoBlockSizeSam ); vecdNetwData.Init ( iMonoBlockSizeSam );
// init response time evaluation // init response time evaluation
CycleTimeVariance.Init ( LEN_MOV_AV_RESPONSE ); CycleTimeVariance.Init (
TIME_MOV_AV_RESPONSE * SYSTEM_SAMPLE_RATE / iMonoBlockSizeSam );
CycleTimeVariance.Reset(); CycleTimeVariance.Reset();
AudioReverb.Clear(); AudioReverb.Clear();
@ -428,7 +430,9 @@ void CClient::UpdateSocketBufferSize()
// completely filled // completely filled
const double dHysteresis = 0.3; const double dHysteresis = 0.3;
if ( CycleTimeVariance.IsInitialized() ) // it seems that it is better to update the jitter buffer as soon as possible
// even if the value is not optimal right from the beginning
if ( 1 ) // previously -> CycleTimeVariance.IsInitialized()
{ {
// calculate current buffer setting // calculate current buffer setting
// TODO 2* seems not give optimal results, maybe use 3*? // TODO 2* seems not give optimal results, maybe use 3*?
@ -442,8 +446,8 @@ void CClient::UpdateSocketBufferSize()
// the block sizes do not have this relation, we require to have // the block sizes do not have this relation, we require to have
// a minimum buffer size of the sum of both sizes // a minimum buffer size of the sum of both sizes
const double dAudioBufferDurationMs = const double dAudioBufferDurationMs =
( iMonoBlockSizeSam + Channel.GetAudioBlockSizeIn() ) / ( iMonoBlockSizeSam + Channel.GetAudioBlockSizeIn() ) * 1000 /
SYSTEM_SAMPLE_RATE * 1000; SYSTEM_SAMPLE_RATE;
const double dEstCurBufSet = ( dAudioBufferDurationMs + const double dEstCurBufSet = ( dAudioBufferDurationMs +
2 * ( CycleTimeVariance.GetStdDev() + 0.5 ) ) / 2 * ( CycleTimeVariance.GetStdDev() + 0.5 ) ) /

View file

@ -108,7 +108,7 @@
// length of the moving average buffer for response time measurement // length of the moving average buffer for response time measurement
#define TIME_MOV_AV_RESPONSE 30 // seconds #define TIME_MOV_AV_RESPONSE 30 // seconds
#define LEN_MOV_AV_RESPONSE ( TIME_MOV_AV_RESPONSE * 1000 / MIN_SERVER_BLOCK_DURATION_MS ) #define LEN_MOV_AV_RESPONSE_SERVER ( TIME_MOV_AV_RESPONSE * 1000 / MIN_SERVER_BLOCK_DURATION_MS )
// GUI definition: width/heigth size of LED pixmaps // GUI definition: width/heigth size of LED pixmaps
#define LED_WIDTH_HEIGHT_SIZE_PIXEL 20 #define LED_WIDTH_HEIGHT_SIZE_PIXEL 20

View file

@ -37,7 +37,7 @@ CServer::CServer ( const QString& strLoggingFileName,
vecsSendData.Init ( MIN_SERVER_BLOCK_SIZE_SAMPLES ); vecsSendData.Init ( MIN_SERVER_BLOCK_SIZE_SAMPLES );
// init moving average buffer for response time evaluation // init moving average buffer for response time evaluation
CycleTimeVariance.Init ( LEN_MOV_AV_RESPONSE ); CycleTimeVariance.Init ( LEN_MOV_AV_RESPONSE_SERVER );
// connect timer timeout signal // connect timer timeout signal
QObject::connect ( &Timer, SIGNAL ( timeout() ), QObject::connect ( &Timer, SIGNAL ( timeout() ),