diff options
author | Henri Herscher <henri@oreka.org> | 2006-02-15 22:12:36 +0000 |
---|---|---|
committer | Henri Herscher <henri@oreka.org> | 2006-02-15 22:12:36 +0000 |
commit | eb16e055fe7a80e88b56879f73bd2bfc15b765fd (patch) | |
tree | b860b887715679448fda065826fadaf611165e24 | |
parent | 8fcd04d8530222406466b279224a5f9622b49e78 (diff) |
Added sanity checks on incoming RTP timestamps
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@180 09dcff7a-b715-0410-9601-b79a96267cd0
-rw-r--r-- | orkaudio/filters/rtpmixer/RtpMixer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/orkaudio/filters/rtpmixer/RtpMixer.cpp b/orkaudio/filters/rtpmixer/RtpMixer.cpp index 6eb26fa..6219b84 100644 --- a/orkaudio/filters/rtpmixer/RtpMixer.cpp +++ b/orkaudio/filters/rtpmixer/RtpMixer.cpp @@ -108,7 +108,7 @@ void RtpMixer::AudioChunkIn(AudioChunkRef& chunk) } else if (details->m_timestamp >= m_readTimestamp) // drop packets that are older than last shipment { - if( (int)(rtpEndTimestamp - m_writeTimestamp) <= (int)FreeSpace()) + if( (int)(rtpEndTimestamp - m_writeTimestamp) <= (int)FreeSpace() && (int)(m_writeTimestamp - details->m_timestamp) <= (int)UsedSpace()) { // RTP packet fits into current buffer StoreRtpPacket(chunk); @@ -125,7 +125,7 @@ void RtpMixer::AudioChunkIn(AudioChunkRef& chunk) // work out how much silence we need to add to the current buffer when shipping size_t silenceSize = details->m_timestamp - m_writeTimestamp; - if(silenceSize < (8000*60) ) // sanity check, maximum silence is 60 seconds @8KHz, otherwise, drop the chunk + if(silenceSize < (8000*60) && (details->m_timestamp > m_writeTimestamp)) // sanity check, maximum silence is 60 seconds @8KHz, otherwise, drop the chunk { CreateShipment(silenceSize); |