diff --git a/src/clientsettingsdlg.cpp b/src/clientsettingsdlg.cpp index 8f203d25..0c6209a2 100755 --- a/src/clientsettingsdlg.cpp +++ b/src/clientsettingsdlg.cpp @@ -279,13 +279,12 @@ void CClientSettingsDlg::OnPingTimeResult ( int iPingTime ) const int iTotalJitterBufferDelayMS = MIN_SERVER_BLOCK_DURATION_MS * ( 2 /* buffer at client and server */ * pClient->GetSockBufSize() ) / 2; - -// TODO consider sound card interface block size - -const int iTotalSoundCardDelayMS = 0; -// const int iTotalSoundCardDelayMS = 2 * MIN_SERVER_BLOCK_DURATION_MS + -// MIN_SERVER_BLOCK_DURATION_MS * ( pClient->GetSndInterface()->GetInNumBuf() + -// pClient->GetSndInterface()->GetOutNumBuf() ) / 2; + // we assume that we have two period sizes for the input and one for the + // output, therefore we have "3 *" instead of "2 *" (for input and output) + // the actual sound card buffer size + const int iTotalSoundCardDelayMS = + 3 * pClient->GetSndCrdActualMonoBlSize() * + 1000 / SND_CRD_SAMPLE_RATE; const int iDelayToFillNetworkPackets = ( pClient->GetNetwBufSizeOut() + pClient->GetAudioBlockSizeIn() ) * diff --git a/src/socket.h b/src/socket.h index 6e99320d..04483245 100755 --- a/src/socket.h +++ b/src/socket.h @@ -50,7 +50,7 @@ public: CSocket ( CChannel* pNewChannel, const quint16 iPortNumber ) : pChannel( pNewChannel ), bIsClient ( true ) { Init ( iPortNumber ); } CSocket ( CChannelSet* pNewChannelSet, QObject* pNServP, const quint16 iPortNumber ) : - pChannelSet(pNewChannelSet), pServer ( pNServP ), bIsClient ( false ) + pChannelSet ( pNewChannelSet ), pServer ( pNServP ), bIsClient ( false ) { Init ( iPortNumber ); } virtual ~CSocket() {} @@ -65,7 +65,7 @@ protected: CVector vecbyRecBuf; CHostAddress RecHostAddr; - CChannel* pChannel; // for client + CChannel* pChannel; // for client CChannelSet* pChannelSet; // for server QObject* pServer;