]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
sync
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 12 Mar 2008 13:41:30 +0000 (13:41 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 12 Mar 2008 13:41:30 +0000 (13:41 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7879 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_rtp.c

index 06d1fdf8f30c26bb5dd3002b2b2a1cfba3ab4015..b98bfb5223c2a5096b56a6796f05f3027ed75968 100644 (file)
@@ -1141,8 +1141,13 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                        if (bytes) {
                                check++;
                                switch_core_timer_sync(&rtp_session->timer);
+                       } else {
+                               check = (uint8_t) (switch_core_timer_check(&rtp_session->timer, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS);                                         
                        }
-                       check = (uint8_t) (switch_core_timer_check(&rtp_session->timer, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS);
+               } 
+
+               if (check) {
+                       do_2833(rtp_session);
                }
 
                if (bytes && rtp_session->recv_msg.header.version != 2) {
@@ -1303,8 +1308,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                        }
                }
 
-               if (check) {
-                       do_2833(rtp_session);
+               if (check || (bytes && !rtp_session->timer.interval)) {
                        if (!bytes && rtp_session->max_missed_packets) {
                                if (++rtp_session->missed_count >= rtp_session->max_missed_packets) {
                                        ret = -2;
@@ -1401,10 +1405,6 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                        *flags |= SFF_CNG;
                }
 
-               if (bytes > 0) {
-                       do_2833(rtp_session);
-               }
-
                ret = (int) bytes;
        } else {
                ret = -1;