From d99a59b0f48efc1c14474ef7b252dace21e480c5 Mon Sep 17 00:00:00 2001 From: Henri Herscher Date: Thu, 9 Feb 2006 22:58:10 +0000 Subject: Dismiss Comfort noise packets + make sure RTP packet size is consistent with speech packet. git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@161 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkaudio/audiocaptureplugins/voip/VoIp.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'orkaudio') diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp index 0b733d3..57ae7a9 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp @@ -148,8 +148,8 @@ bool TryRtp(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader, UdpH u_short dest = ntohs(udpHeader->dest); if(!(ntohs(udpHeader->source)%2) && !(ntohs(udpHeader->dest)%2)) // udp ports must be even { - if(rtpHeader->pt <= 34 ) // pt=34 is H263 and is the last possible valid codec - { + if(rtpHeader->pt <= 34 && rtpHeader->pt != 13) // pt=34 is H263 and is the last possible valid codec + { // pt=13 is CN (Comfort Noise) result = true; u_char* payload = (u_char *)rtpHeader + sizeof(RtpHeaderStruct); u_char* packetEnd = (u_char *)ipHeader + ntohs(ipHeader->ip_len); @@ -173,8 +173,10 @@ bool TryRtp(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader, UdpH rtpInfo->ToString(debug); LOG4CXX_DEBUG(s_rtpPacketLog, debug); } - - RtpSessionsSingleton::instance()->ReportRtpPacket(rtpInfo); + if(payloadLength < 800) // sanity check, speech RTP payload should always be smaller + { + RtpSessionsSingleton::instance()->ReportRtpPacket(rtpInfo); + } } else { -- cgit v1.2.3