From 3d979dd4fe75b4e4309dd6bf815e040706b6242d Mon Sep 17 00:00:00 2001 From: henrih Date: Fri, 6 Nov 2009 21:46:16 +0000 Subject: Fixed garbled or missing audio when multiple RTP streams are seen in a single session. git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@651 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkaudio/audiocaptureplugins/voip/RtpSession.cpp | 15 ++++++++++----- orkaudio/audiocaptureplugins/voip/RtpSession.h | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp index bf19956..5fdca67 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp @@ -70,6 +70,7 @@ RtpSession::RtpSession(CStdString& trackingId) m_rtpIp.s_addr = 0; m_skinnyLineInstance = 0; m_onDemand = false; + m_newRtpStream = true; } void RtpSession::Stop() @@ -1017,9 +1018,12 @@ bool RtpSession::AddRtpPacket(RtpPacketInfoRef& rtpPacket) else { // Comparing destination IP address and port to find out if side1, see (1) - if((unsigned int)rtpPacket->m_destIp.s_addr == (unsigned int)m_lastRtpPacketSide1->m_destIp.s_addr && - rtpPacket->m_destPort == m_lastRtpPacketSide1->m_destPort) + if( m_newRtpStream == true || + ( (unsigned int)rtpPacket->m_destIp.s_addr == (unsigned int)m_lastRtpPacketSide1->m_destIp.s_addr && + rtpPacket->m_destPort == m_lastRtpPacketSide1->m_destPort ) ) { + m_newRtpStream = false; + if(rtpPacket->m_timestamp == m_lastRtpPacketSide1->m_timestamp) { m_hasDuplicateRtp = true; @@ -1102,9 +1106,10 @@ bool RtpSession::AddRtpPacket(RtpPacketInfoRef& rtpPacket) bool hasDestAddress = m_rtpAddressList.HasAddressOrAdd(rtpPacket->m_destIp, rtpPacket->m_destPort); if( hasSourceAddress == false || hasDestAddress == false ) { + m_newRtpStream = true; rtpPacket->ToString(logMsg); - logMsg.Format("[%s] new RTP stream s%d: %s", - m_trackingId, channel, logMsg); + logMsg.Format("[%s] new RTP stream: %s", + m_trackingId, logMsg); LOG4CXX_INFO(m_log, logMsg); if(m_protocol == ProtSip && m_started) // make sure this only happens if ReportMetadata() already been called for the session @@ -2408,7 +2413,7 @@ void RtpSessions::SetEndpointExtension(CStdString& extension, struct in_addr* en // Create endpoint info for the new endpoint endpoint.reset(new EndpointInfo()); endpoint->m_extension = extension; - ACE_OS::memcpy(&endpoint->m_ip, endpointIp, sizeof(endpoint->m_ip)); + memcpy(&endpoint->m_ip, endpointIp, sizeof(endpoint->m_ip)); if(callId.size()) { endpoint->m_latestCallId = callId; diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.h b/orkaudio/audiocaptureplugins/voip/RtpSession.h index 2dd7f15..843ce57 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.h +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.h @@ -220,6 +220,7 @@ public: bool m_nonLookBackSessionStarted; bool m_onDemand; std::list m_otherIpAndPortMappings; + bool m_newRtpStream; private: void ProcessMetadataSip(RtpPacketInfoRef&); -- cgit v1.2.3