summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenri Herscher <henri@oreka.org>2006-02-09 22:58:10 +0000
committerHenri Herscher <henri@oreka.org>2006-02-09 22:58:10 +0000
commitd99a59b0f48efc1c14474ef7b252dace21e480c5 (patch)
tree868f356eb4e03bbdea96b4bcb1f10834ae3c312b
parentec7f2a3ec8904ccf83269ed5d0376f8fb8b1bf3d (diff)
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
-rw-r--r--orkaudio/audiocaptureplugins/voip/VoIp.cpp10
1 files changed, 6 insertions, 4 deletions
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
{