diff options
Diffstat (limited to 'orkaudio/audiocaptureplugins')
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/RtpSession.cpp | 23 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/RtpSession.h | 2 |
2 files changed, 11 insertions, 14 deletions
diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp index d59e43d..1e18e45 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp @@ -45,7 +45,7 @@ RtpSession::RtpSession(CStdString& trackingId) m_numRtpPackets = 0; m_started = false; m_stopped = false; - m_rtpTimestampCorrectiveOffset = 0; + m_rtpTimestampCorrectiveDelta = 0; } void RtpSession::Stop() @@ -334,27 +334,24 @@ void RtpSession::AddRtpPacket(RtpPacketInfoRef& rtpPacket) } } - // Compute the corrective offset (only if the two streams have greatly different timestamp, eg for Cisco CallManager) - if(m_rtpTimestampCorrectiveOffset == 0 && m_lastRtpPacketSide2.get() != NULL) + // Compute the corrective offset + if(m_rtpTimestampCorrectiveDelta == 0 && m_lastRtpPacketSide2.get() != NULL) { - //if (m_lastRtpPacketSide2->m_arrivalTimestamp == m_lastRtpPacketSide1->m_arrivalTimestamp) + int timestampOffset = m_lastRtpPacketSide2->m_timestamp - m_lastRtpPacketSide1->m_timestamp; + //if(timestampOffset > 8000 || timestampOffset < -8000) // 1s @ 8KHz //{ - int timestampOffset = m_lastRtpPacketSide2->m_timestamp - m_lastRtpPacketSide1->m_timestamp; - if(timestampOffset > 8000 || timestampOffset < -8000) // 1s @ 8KHz + m_rtpTimestampCorrectiveDelta = timestampOffset; + if(m_log->isDebugEnabled()) { - m_rtpTimestampCorrectiveOffset = timestampOffset; - if(m_log->isDebugEnabled()) - { - CStdString timestampOffsetString = IntToString(timestampOffset); - LOG4CXX_DEBUG(m_log, m_trackingId + ": " + m_capturePort + ": " + "Applying timestamp corrective offset:" + timestampOffsetString); - } + CStdString timestampOffsetString = IntToString(timestampOffset); + LOG4CXX_DEBUG(m_log, m_trackingId + ": " + m_capturePort + ": " + "Applying timestamp corrective offset:" + timestampOffsetString); } //} } // apply the corrective offset if(m_lastRtpPacketSide2.get() != NULL) { - m_lastRtpPacketSide2->m_timestamp = m_lastRtpPacketSide2->m_timestamp - m_rtpTimestampCorrectiveOffset; + m_lastRtpPacketSide2->m_timestamp = m_lastRtpPacketSide2->m_timestamp - m_rtpTimestampCorrectiveDelta; } if(m_log->isDebugEnabled()) diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.h b/orkaudio/audiocaptureplugins/voip/RtpSession.h index a745c38..45a60cd 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.h +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.h @@ -121,7 +121,7 @@ private: CStdString m_capturePort; bool m_started; bool m_stopped; - int m_rtpTimestampCorrectiveOffset; + int m_rtpTimestampCorrectiveDelta; }; typedef boost::shared_ptr<RtpSession> RtpSessionRef; |