]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
small refactor
authorAnthony Minessale <anthony.minessale@gmail.com>
Sat, 31 Oct 2009 22:13:15 +0000 (22:13 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sat, 31 Oct 2009 22:13:15 +0000 (22:13 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15305 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_rtp.c

index 0347d211bee12ed3b6ac92f68268bd653b78a96c..d956bf0b1c0005058ff7fb58b1419b59020b060e 100644 (file)
@@ -1936,12 +1936,18 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                }
                
                /* 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)) {