diff options
author | henrih <henrih@09dcff7a-b715-0410-9601-b79a96267cd0> | 2009-11-06 21:46:16 +0000 |
---|---|---|
committer | henrih <henrih@09dcff7a-b715-0410-9601-b79a96267cd0> | 2009-11-06 21:46:16 +0000 |
commit | 3d979dd4fe75b4e4309dd6bf815e040706b6242d (patch) | |
tree | 611225ef0dbb3196c9f28a5d138bc08d9feb80cb /orkaudio/audiocaptureplugins/voip/RtpSession.cpp | |
parent | f34f0ec5187ab8d0d6d67afc4be791cefc0ad93d (diff) |
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
Diffstat (limited to 'orkaudio/audiocaptureplugins/voip/RtpSession.cpp')
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/RtpSession.cpp | 15 |
1 files changed, 10 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; |