]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSRTP-10
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 30 Dec 2009 23:10:38 +0000 (23:10 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 30 Dec 2009 23:10:38 +0000 (23:10 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16100 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_rtp.c

index fac5a0970440e72ea8cf72d03c96ca4053668d82..9ff3107a490014d00f70f766fc2f6fa3b0c05e01 100644 (file)
@@ -1879,8 +1879,16 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                        }
 
                        poll_loop = 1;
-                       rtp_session->missed_count += (poll_sec * 1000 ) / (rtp_session->ms_per_packet ? rtp_session->ms_per_packet : 20 / 1000);
+                       rtp_session->missed_count += (poll_sec * 1000 ) / (rtp_session->ms_per_packet ? rtp_session->ms_per_packet / 1000 : 20 );
                        bytes = 0;
+
+                       if (rtp_session->max_missed_packets) {
+                               if (rtp_session->missed_count >= rtp_session->max_missed_packets) {
+                                       ret = -2;
+                                       goto end;
+                               }
+                       }
+
                        if (rtp_session->dtmf_data.out_digit_dur == 0 || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) {
                                return_cng_frame();
                        }