diff --git a/src/client.cpp b/src/client.cpp index 6e250834..3a2fbfa4 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -1098,6 +1098,24 @@ void CClient::ProcessAudioDataIntern ( CVector& vecsStereoSndCrd ) // Receive signal ---------------------------------------------------------- + + +// TODO: Get all the received packets from the Socket interface here in this +// high priority thread and put them in the jitter buffer. This has the +// advantage that we only have two threads, one low priority thread for +// the GUI and one high priority thread for the audio and socket. +// PROBLEMS: - If we are not connected, the old callback mechanism in the socket +// must be used instead +// - The ping message relys on that the packet is immediatly parsed +// not only if an audio packet has to be processed. Therefore the +// ping measurements will be too high which is not acceptable. +// - The thread synchronization is more critical than in the current +// implementation so that crashes may occur. +// +// e.g., do the following: +// Socket.GetDataFromSocket(); + + for ( i = 0; i < iSndCrdFrameSizeFactor; i++ ) { // receive a new block diff --git a/src/socket.cpp b/src/socket.cpp index 3063f2ad..aa86ff2b 100755 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -47,7 +47,7 @@ void CSocket::Init ( const quint16 iPortNumber ) ( iClientPortIncrement <= NUM_SOCKET_PORTS_TO_TRY ) ) { bSuccess = SocketDevice.bind ( - QHostAddress( QHostAddress::Any ), + QHostAddress ( QHostAddress::Any ), iPortNumber + iClientPortIncrement ); iClientPortIncrement++; @@ -187,6 +187,14 @@ void CSocket::OnDataReceived() if ( pServer->PutData ( vecbyRecBuf, iNumBytesRead, RecHostAddr ) ) { + + +// TODO: we should only post the event in case the server is turned off for +// speed optimization and avoiding possible locks +//if ( !pServer->IsRunning() ) +//{ + + // this was an audio packet, start server // tell the server object to wake up if it // is in sleep mode (Qt will delete the event object when done)