]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8130 regression causing excessive mark bit detection in some cases
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 22 Oct 2015 18:07:07 +0000 (13:07 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 22 Oct 2015 18:07:18 +0000 (13:07 -0500)
src/switch_rtp.c

index 67ce8447ae6408dddd9775fde58c0a88f969e87d..92191335b71f0b637b33b66c19267b0db633209a 100644 (file)
@@ -5510,6 +5510,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
        }
 
        if (rtp_session->has_rtp && *bytes) {
+               uint32_t read_ssrc = ntohl(rtp_session->last_rtp_hdr.ssrc);
 
                if (rtp_session->vb && jb_valid(rtp_session)) {
                        status = switch_jb_put_packet(rtp_session->vb, (switch_rtp_packet_t *) &rtp_session->recv_msg, *bytes);                 
@@ -5527,12 +5528,8 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
                }
 
                if (rtp_session->jb && !rtp_session->pause_jb && jb_valid(rtp_session)) {
-                       uint32_t read_ssrc = ntohl(rtp_session->last_rtp_hdr.ssrc);
 
-                       if (rtp_session->last_rtp_hdr.m && rtp_session->last_rtp_hdr.pt != rtp_session->recv_te && 
-                               !rtp_session->flags[SWITCH_RTP_FLAG_VIDEO] && !(rtp_session->rtp_bugs & RTP_BUG_IGNORE_MARK_BIT)) {
-                               switch_jb_reset(rtp_session->jb);
-                       } else if (rtp_session->last_jb_read_ssrc && rtp_session->last_jb_read_ssrc != read_ssrc) {
+                       if (rtp_session->last_jb_read_ssrc && rtp_session->last_jb_read_ssrc != read_ssrc) {
                                switch_jb_reset(rtp_session->jb);
                        }
 
@@ -5555,6 +5552,13 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
                        if (!return_jb_packet) {
                                return status;
                        }
+               } else {
+                       if (rtp_session->last_rtp_hdr.m && rtp_session->last_rtp_hdr.pt != rtp_session->recv_te && 
+                               !rtp_session->flags[SWITCH_RTP_FLAG_VIDEO] && !(rtp_session->rtp_bugs & RTP_BUG_IGNORE_MARK_BIT)) {
+                               switch_rtp_set_flag(rtp_session, SWITCH_RTP_FLAG_FLUSH);
+                       } else if (rtp_session->last_jb_read_ssrc && rtp_session->last_jb_read_ssrc != read_ssrc) {
+                               switch_rtp_set_flag(rtp_session, SWITCH_RTP_FLAG_FLUSH);
+                       }
                }
        }