some fixes

This commit is contained in:
Volker Fischer 2011-05-28 14:39:13 +00:00
parent 70f0c66b85
commit 16f1bb0eb3
5 changed files with 10 additions and 16 deletions

View File

@ -359,6 +359,9 @@ void CChannel::OnNetTranspPropsReceived ( CNetworkTransportProps NetworkTranspor
// init conversion buffer // init conversion buffer
ConvBuf.Init ( iNetwFrameSize * iNetwFrameSizeFact ); ConvBuf.Init ( iNetwFrameSize * iNetwFrameSizeFact );
// reset statistic
CycleTimeVariance.Reset();
} }
} }
@ -605,8 +608,7 @@ int CChannel::GetUploadRateKbps()
SYSTEM_SAMPLE_RATE_HZ / iAudioSizeOut / 1000; SYSTEM_SAMPLE_RATE_HZ / iAudioSizeOut / 1000;
} }
void CChannel::UpdateSocketBufferSize ( const double dAudioBufferDurationMs, void CChannel::UpdateSocketBufferSize ( const double dLocalStdDev )
const double dLocalStdDev )
{ {
// just update the socket buffer size if auto setting is enabled, otherwise // just update the socket buffer size if auto setting is enabled, otherwise
// do nothing // do nothing
@ -631,7 +633,7 @@ void CChannel::UpdateSocketBufferSize ( const double dAudioBufferDurationMs,
// add 0.5 to "round up" -> ceil, // add 0.5 to "round up" -> ceil,
// divide by MIN_SERVER_BLOCK_DURATION_MS because this is the size of // divide by MIN_SERVER_BLOCK_DURATION_MS because this is the size of
// one block in the jitter buffer // one block in the jitter buffer
const double dEstCurBufSet = ( dAudioBufferDurationMs + const double dEstCurBufSet = ( SYSTEM_BLOCK_DURATION_MS_FLOAT +
3.3 * ( CycleTimeVariance.GetStdDev() + dLocalStdDev ) ) / 3.3 * ( CycleTimeVariance.GetStdDev() + dLocalStdDev ) ) /
SYSTEM_BLOCK_DURATION_MS_FLOAT + 0.5; SYSTEM_BLOCK_DURATION_MS_FLOAT + 0.5;

View File

@ -96,8 +96,7 @@ public:
const bool bPreserve = false ); const bool bPreserve = false );
int GetSockBufNumFrames() const { return iCurSockBufNumFrames; } int GetSockBufNumFrames() const { return iCurSockBufNumFrames; }
void UpdateSocketBufferSize ( const double dAudioBufferDurationMs, void UpdateSocketBufferSize ( const double dLocalStdDev );
const double dLocalStdDev );
int GetUploadRateKbps(); int GetUploadRateKbps();

View File

@ -946,15 +946,8 @@ void CClient::ProcessAudioDataIntern ( CVector<int16_t>& vecsStereoSndCrd )
// update response time measurement // update response time measurement
CycleTimeVariance.Update(); CycleTimeVariance.Update();
// calculate current buffer setting
const double dAudioBufferDurationMs =
static_cast<double> ( GetSndCrdActualMonoBlSize() +
GetSndCrdConvBufAdditionalDelayMonoBlSize() ) *
1000 / SYSTEM_SAMPLE_RATE_HZ;
// update socket buffer size // update socket buffer size
Channel.UpdateSocketBufferSize ( dAudioBufferDurationMs, Channel.UpdateSocketBufferSize ( CycleTimeVariance.GetStdDev() );
CycleTimeVariance.GetStdDev() );
} }
int CClient::EstimatedOverallDelay ( const int iPingTimeMs ) int CClient::EstimatedOverallDelay ( const int iPingTimeMs )

View File

@ -717,8 +717,6 @@
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<tabstops> <tabstops>
<tabstop>chbAutoJitBuf</tabstop>
<tabstop>sldNetBuf</tabstop>
<tabstop>cbxSoundcard</tabstop> <tabstop>cbxSoundcard</tabstop>
<tabstop>cbxLInChan</tabstop> <tabstop>cbxLInChan</tabstop>
<tabstop>cbxRInChan</tabstop> <tabstop>cbxRInChan</tabstop>
@ -728,6 +726,9 @@
<tabstop>rbtBufferDelayDefault</tabstop> <tabstop>rbtBufferDelayDefault</tabstop>
<tabstop>rbtBufferDelaySafe</tabstop> <tabstop>rbtBufferDelaySafe</tabstop>
<tabstop>butDriverSetup</tabstop> <tabstop>butDriverSetup</tabstop>
<tabstop>chbAutoJitBuf</tabstop>
<tabstop>sldNetBuf</tabstop>
<tabstop>sldNetBufServer</tabstop>
<tabstop>chbOpenChatOnNewMessage</tabstop> <tabstop>chbOpenChatOnNewMessage</tabstop>
<tabstop>chbGUIDesignFancy</tabstop> <tabstop>chbGUIDesignFancy</tabstop>
<tabstop>chbUseHighQualityAudio</tabstop> <tabstop>chbUseHighQualityAudio</tabstop>

View File

@ -679,7 +679,6 @@ void CServer::OnTimer()
// update socket buffer size // update socket buffer size
vecChannels[iCurChanID].UpdateSocketBufferSize ( vecChannels[iCurChanID].UpdateSocketBufferSize (
SYSTEM_BLOCK_DURATION_MS_FLOAT,
CycleTimeVariance.GetStdDev() ); CycleTimeVariance.GetStdDev() );
} }
} }