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
// one block in the jitter buffer
// TODO use max(audioMs, receivedNetpacketsMs)
const double dAudioBufferDurationMs =
iMonoBlockSizeSam / SYSTEM_SAMPLE_RATE * 1000;
// Use worst case scenario: We add the block size of input and
// output. This is not required if the smaller block size is a
// 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 +
3 * ( CycleTimeVariance.GetStdDev() + 0.5 ) ) /
2 * ( CycleTimeVariance.GetStdDev() + 0.5 ) ) /
MIN_SERVER_BLOCK_DURATION_MS;
// upper/lower hysteresis decision

View File

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

View File

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

View File

@ -440,22 +440,19 @@ public:
class CSndCrdBufferSizes
{
public:
static int GetNumOfBufferSizes() { return 30; }
// we use a conservative value as default, this value does not
// give perfekt latency results but should work ok on most
// sound cards and drivers
static int GetDefaultIndex() { return 5; }
static int GetNumOfBufferSizes() { return 16; }
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,
384, 416, 448, 480, 512, 544, 576, 608, 640,
672, 704, 736, 768, 800, 832, 864, 896, 928,
960, 992, 1024 };
384, 416, 448, 480, 512, 768, 1024 };
return pSizes[iIdx];
}