removed some qDebug(), less number of possible audio block sizes, fix for auto jitter buffer -> still not ready

This commit is contained in:
Volker Fischer 2009-03-08 07:26:01 +00:00
parent 3bf3ab832d
commit d3c76269d2
4 changed files with 20 additions and 16 deletions

View File

@ -436,12 +436,17 @@ void CClient::UpdateSocketBufferSize()
// 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
// TODO use max(audioMs, receivedNetpacketsMs) // Use worst case scenario: We add the block size of input and
const double dAudioBufferDurationMs = // output. This is not required if the smaller block size is a
iMonoBlockSizeSam / SYSTEM_SAMPLE_RATE * 1000; // multiple of the bigger size, but in the general case where
// the block sizes do not have this relation, we require to have
// a minimum buffer size of the sum of both sizes
const double dAudioBufferDurationMs =
( iMonoBlockSizeSam + Channel.GetAudioBlockSizeIn() ) /
SYSTEM_SAMPLE_RATE * 1000;
const double dEstCurBufSet = ( dAudioBufferDurationMs + const double dEstCurBufSet = ( dAudioBufferDurationMs +
3 * ( CycleTimeVariance.GetStdDev() + 0.5 ) ) / 2 * ( CycleTimeVariance.GetStdDev() + 0.5 ) ) /
MIN_SERVER_BLOCK_DURATION_MS; MIN_SERVER_BLOCK_DURATION_MS;
// upper/lower hysteresis decision // upper/lower hysteresis decision

View File

@ -212,7 +212,7 @@ int main ( int argc, char** argv )
else else
{ {
// only start application without using the GUI // only start application without using the GUI
cout << CAboutDlg::GetVersionAndNameStr ( false ).toStdString(); cout << CAboutDlg::GetVersionAndNameStr ( false ).toStdString() << std::endl;
app.exec(); app.exec();
} }
} }

View File

@ -119,8 +119,9 @@ void CServer::Stop()
const QString strLogStr = CLogTimeDate::toString() + ",, server stopped " const QString strLogStr = CLogTimeDate::toString() + ",, server stopped "
"-------------------------------------"; "-------------------------------------";
qDebug() << strLogStr; // on console QTextStream tsConsoloeStream ( stdout );
Logging << strLogStr; // in log file tsConsoloeStream << strLogStr << endl; // on console
Logging << strLogStr; // in log file
} }
void CServer::OnNewChannel ( CHostAddress ChanAddr ) void CServer::OnNewChannel ( CHostAddress ChanAddr )
@ -129,8 +130,9 @@ void CServer::OnNewChannel ( CHostAddress ChanAddr )
const QString strLogStr = CLogTimeDate::toString() + ", " + const QString strLogStr = CLogTimeDate::toString() + ", " +
ChanAddr.InetAddr.toString() + ", connected"; ChanAddr.InetAddr.toString() + ", connected";
qDebug() << strLogStr; // on console QTextStream tsConsoloeStream ( stdout );
Logging << strLogStr; // in log file tsConsoloeStream << strLogStr << endl; // on console
Logging << strLogStr; // in log file
} }
void CServer::OnTimer() void CServer::OnTimer()

View File

@ -440,22 +440,19 @@ public:
class CSndCrdBufferSizes class CSndCrdBufferSizes
{ {
public: public:
static int GetNumOfBufferSizes() { return 30; }
// we use a conservative value as default, this value does not // we use a conservative value as default, this value does not
// give perfekt latency results but should work ok on most // give perfekt latency results but should work ok on most
// sound cards and drivers // sound cards and drivers
static int GetDefaultIndex() { return 5; } static int GetDefaultIndex() { return 5; }
static int GetNumOfBufferSizes() { return 16; }
static int GetBufferSizeFromIndex ( const int iIdx ) static int GetBufferSizeFromIndex ( const int iIdx )
{ {
if ( ( iIdx >= 0 ) && ( iIdx < 30 ) ) if ( ( iIdx >= 0 ) && ( iIdx < 16 ) )
{ {
const int pSizes[30] = { const int pSizes[16] = {
96, 128, 160, 192, 224, 256, 288, 320, 352, 96, 128, 160, 192, 224, 256, 288, 320, 352,
384, 416, 448, 480, 512, 544, 576, 608, 640, 384, 416, 448, 480, 512, 768, 1024 };
672, 704, 736, 768, 800, 832, 864, 896, 928,
960, 992, 1024 };
return pSizes[iIdx]; return pSizes[iIdx];
} }