]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3543 --resolve nevermind, found it
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 6 Sep 2011 16:30:28 +0000 (11:30 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 6 Sep 2011 16:30:28 +0000 (11:30 -0500)
src/switch_rtp.c

index eb431d0e3ba7280c628d9d84ba49faed5f1eb850..6d51bf296311e42b305720f7b6921bc27bd7ebda 100644 (file)
@@ -2403,18 +2403,23 @@ static void do_2833(switch_rtp_t *rtp_session, switch_core_session_t *session)
 
 SWITCH_DECLARE(void) rtp_flush_read_buffer(switch_rtp_t *rtp_session, switch_rtp_flush_t flush)
 {
-       if (switch_rtp_ready(rtp_session) && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) && 
-               !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) {
-               switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH);
-               switch (flush) {
-               case SWITCH_RTP_FLUSH_STICK:
-                       switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_STICKY_FLUSH);
-                       break;
-               case SWITCH_RTP_FLUSH_UNSTICK:
-                       switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_STICKY_FLUSH);
-                       break;
-               default:
-                       break;
+
+       if (switch_rtp_ready(rtp_session)) {
+               rtp_session->last_write_ts = 0;
+       
+               if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) && 
+                       !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) {
+                       switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH);
+                       switch (flush) {
+                       case SWITCH_RTP_FLUSH_STICK:
+                               switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_STICKY_FLUSH);
+                               break;
+                       case SWITCH_RTP_FLUSH_UNSTICK:
+                               switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_STICKY_FLUSH);
+                               break;
+                       default:
+                               break;
+                       }
                }
        }
 }
@@ -3794,6 +3799,10 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
 
        this_ts = ntohl(send_msg->header.ts);
 
+       if ((this_ts < rtp_session->last_write_ts) && ((rtp_session->last_write_ts - this_ts) > 16000)) {
+               rtp_session->last_write_ts = 0;
+       }
+
        if (!switch_rtp_ready(rtp_session) || rtp_session->sending_dtmf || !this_ts || this_ts < rtp_session->last_write_ts) {
                send = 0;
        }