Commit e32b6da6 authored by Jonas Stienen's avatar Jonas Stienen

Resolving problems with git

parent 6c4f4aa7
...@@ -137,31 +137,33 @@ bool CITANetAudioStreamingClient::LoopBody() ...@@ -137,31 +137,33 @@ bool CITANetAudioStreamingClient::LoopBody()
// Read answer (blocking) // Read answer (blocking)
m_pMessage->ResetMessage( ); m_pMessage->ResetMessage( );
if ( m_pMessage->ReadMessage( 0 ) ) if( m_pMessage->ReadMessage( 0 ) )
{ {
int iMsgType = m_pMessage->GetMessageType( ); int iMsgType = m_pMessage->GetMessageType();
switch( iMsgType )
case CITANetAudioProtocol::NP_INVALID: {
m_pMessage->ReadSampleFrame( &m_sfReceivingBuffer ); case CITANetAudioProtocol::NP_SERVER_SENDING_SAMPLES:
if ( m_pStream->GetRingBufferFreeSamples( ) >= m_sfReceivingBuffer.GetLength( ) ) m_pMessage->ReadSampleFrame( &m_sfReceivingBuffer );
m_pStream->Transmit(m_sfReceivingBuffer, m_sfReceivingBuffer.GetLength()); if( m_pStream->GetRingBufferFreeSamples() >= m_sfReceivingBuffer.GetLength() )
m_pStream->Transmit( m_sfReceivingBuffer, m_sfReceivingBuffer.GetLength() );
#ifdef NET_AUDIO_SHOW_TRAFFIC #ifdef NET_AUDIO_SHOW_TRAFFIC
vstr::out() << "[ITANetAudioStreamingClient] Recived " << m_sfReceivingBuffer.GetLength() << " samples" << std::endl; vstr::out() << "[ITANetAudioStreamingClient] Recived " << m_sfReceivingBuffer.GetLength() << " samples" << std::endl;
#endif #endif
break; break;
case CITANetAudioProtocol::NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES: case CITANetAudioProtocol::NP_SERVER_GET_RINGBUFFER_FREE_SAMPLES:
m_pMessage->ReadBool(); m_pMessage->ReadBool();
m_pMessage->SetMessageType( CITANetAudioProtocol::NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES ); m_pMessage->SetMessageType( CITANetAudioProtocol::NP_CLIENT_SENDING_RINGBUFFER_FREE_SAMPLES );
m_pMessage->WriteInt( m_pStream->GetRingBufferFreeSamples( ) ); m_pMessage->WriteInt( m_pStream->GetRingBufferFreeSamples() );
m_pMessage->WriteMessage(); m_pMessage->WriteMessage();
break; break;
case CITANetAudioProtocol::NP_SERVER_CLOSE: case CITANetAudioProtocol::NP_SERVER_CLOSE:
Disconnect( ); Disconnect();
break; break;
default: default:
vstr::out( ) << "[ITANetAudioStreamingServer] Unkown protocol type : " << iMsgType << std::endl; vstr::out() << "[ITANetAudioStreamingServer] Unkown protocol type : " << iMsgType << std::endl;
break; break;
} }
oLog.iChannel = m_pStream->GetNumberOfChannels(); oLog.iChannel = m_pStream->GetNumberOfChannels();
oLog.iProtocolStatus = iMsgType; oLog.iProtocolStatus = iMsgType;
oLog.iFreeSamples = m_pStream->GetRingBufferFreeSamples(); oLog.iFreeSamples = m_pStream->GetRingBufferFreeSamples();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment