Commit 1bfecbc7 authored by Anne Heimes's avatar Anne Heimes

anpassung für latenz auf dem server - Client

parent c1f56f7a
......@@ -65,6 +65,7 @@ public:
double dSampleRate;
int iBlockSize;
int iRingBufferSize;
int iTargetSampleLatency;
inline StreamingParameters()
{
......@@ -72,11 +73,16 @@ public:
dSampleRate = 0.0f;
iBlockSize = 0;
iRingBufferSize = 0;
iTargetSampleLatency = 0;
};
inline bool operator==( const StreamingParameters& rhs )
{
if ( ( iChannels == rhs.iChannels ) && ( dSampleRate == rhs.dSampleRate ) && ( iBlockSize == rhs.iBlockSize ) && ( iRingBufferSize == rhs.iRingBufferSize ) )
if ( ( iChannels == rhs.iChannels )
&& ( dSampleRate == rhs.dSampleRate )
&& (iBlockSize == rhs.iBlockSize)
&& (iRingBufferSize == rhs.iRingBufferSize)
&& (iTargetSampleLatency == rhs.iTargetSampleLatency))
return true;
else
return false;
......
......@@ -204,7 +204,7 @@ private:
int m_iWriteCursor; //!< Cursor where samples will be fed into ring buffer from net audio producer (always ahead)
bool m_bRingBufferFull; //!< Indicator if ring buffer is full (and read cursor equals write cursor)
ITASampleFrame m_sfRingBuffer; //!< Ring buffer
int m_iTargetSampleLatency; //!< Maximum allowed samples / target sample latency
int m_iTargetSampleLatencyServer; //!< Maximum allowed samples / target sample latency
int m_iStreamingStatus; //!< Current streaming status
double m_dLastStreamingTimeCode;
......
......@@ -124,7 +124,7 @@ CITANetAudioStream::CITANetAudioStream( int iChannels, double dSamplingRate, int
, m_bRingBufferFull( false )
, m_iStreamingStatus( INVALID )
, m_dLastStreamingTimeCode( 0.0f )
, m_iTargetSampleLatency( iRingBufferCapacity )
, m_iTargetSampleLatencyServer( iRingBufferCapacity )
{
m_bRingBufferFull = false;
if( iBufferSize > iRingBufferCapacity )
......@@ -157,7 +157,7 @@ CITANetAudioStream::CITANetAudioStream( int iChannels, double dSamplingRate, int
oLog.dSampleRate = m_dSampleRate;
oLog.iBufferSize = GetBlocklength();
oLog.iRingBufferSize = GetRingBufferSize();
oLog.iTargetSampleLatency = m_iTargetSampleLatency;
oLog.iTargetSampleLatency = m_iTargetSampleLatencyServer;
m_pAudioLogger->log( oLog );
}
......@@ -202,17 +202,17 @@ void CITANetAudioStream::SetAllowedLatencySamples( int iLatencySamples )
if( iLatencySamples > GetMaximumLatencySamples() )
ITA_EXCEPT1( INVALID_PARAMETER, "Can not set latency greater than the maximum possible" );
m_iTargetSampleLatency = iLatencySamples;
m_iTargetSampleLatencyServer = iLatencySamples;
}
float CITANetAudioStream::GetAllowedLatencySeconds() const
{
return float( m_iTargetSampleLatency / GetSampleRate() );
return float(m_iTargetSampleLatencyServer / GetSampleRate());
}
int CITANetAudioStream::GetAllowedLatencySamples() const
{
return m_iTargetSampleLatency;
return m_iTargetSampleLatencyServer;
}
int CITANetAudioStream::GetMinimumLatencySamples() const
......
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