Revision
15305
Author
anthm
Date
2009-10-31 17:13:15 -0500 (Sat, 31 Oct 2009)

Log Message

small refactor

Modified Paths

Diff

Modified: freeswitch/trunk/src/switch_rtp.c (15304 => 15305)


--- freeswitch/trunk/src/switch_rtp.c	2009-10-31 18:15:29 UTC (rev 15304)
+++ freeswitch/trunk/src/switch_rtp.c	2009-10-31 22:13:15 UTC (rev 15305)
@@ -1936,12 +1936,18 @@
 		}
 		
 		/* ignore packets not meant for us unless the auto-adjust window is open */
-		if (bytes && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && 
-			(!switch_cmp_addr(rtp_session->from_addr, rtp_session->remote_addr) || 
-			 ((rtp_session->cng_pt && rtp_session->recv_msg.header.pt == rtp_session->cng_pt) || rtp_session->recv_msg.header.pt == 13))) {
-			bytes = 0;
-			goto recvfrom;			 
-			
+		if (bytes) {
+			if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ)) {
+				if (((rtp_session->cng_pt && rtp_session->recv_msg.header.pt == rtp_session->cng_pt) || rtp_session->recv_msg.header.pt == 13)) {
+					bytes = 0;
+					goto recvfrom;			 
+					
+				} 
+			} else if (!switch_cmp_addr(rtp_session->from_addr, rtp_session->remote_addr)) {
+				bytes = 0;
+				goto recvfrom;			 
+				
+			}
 		}
 
 		if (bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && switch_sockaddr_get_port(rtp_session->from_addr)) {