summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenri Herscher <henri@oreka.org>2006-05-26 14:11:07 +0000
committerHenri Herscher <henri@oreka.org>2006-05-26 14:11:07 +0000
commit9345b3e35fe487b3a83970c51d34e6ecb9497811 (patch)
tree1d02b3372a5ea08b10148c52d28a5d9fc6432463
parente3bd88f136f088a0cbafa78d31ca96eb4c67dd6c (diff)
RTP timestamp corrective delta is now always applied because in some cases, it produced garbled output on one side of the conversation.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@242 09dcff7a-b715-0410-9601-b79a96267cd0
-rw-r--r--orkaudio/audiocaptureplugins/voip/RtpSession.cpp23
-rw-r--r--orkaudio/audiocaptureplugins/voip/RtpSession.h2
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;