From e94ddad1b28dda31928af32a72ebf4127516d531 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 31 Oct 2009 22:13:15 +0000 Subject: [PATCH] small refactor git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15305 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_rtp.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 0347d211be..d956bf0b1c 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -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)) {