From ec2734c10c867a3d390394cb1c3c333d11ec3a2b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 21 Jul 2016 03:22:37 -0500 Subject: [PATCH] FS-9334 revert --- src/switch_jitterbuffer.c | 21 ++++++++------------- src/switch_rtp.c | 4 ++-- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/switch_jitterbuffer.c b/src/switch_jitterbuffer.c index 917dcf8964..427498a5d2 100644 --- a/src/switch_jitterbuffer.c +++ b/src/switch_jitterbuffer.c @@ -614,21 +614,18 @@ static inline void add_node(switch_jb_t *jb, switch_rtp_packet_t *packet, switch if (jb->type == SJB_VIDEO) { if (jb->write_init && ((htons(packet->header.seq) >= htons(jb->highest_wrote_seq) && (ntohl(node->packet.header.ts) > ntohl(jb->highest_wrote_ts))) || (ntohl(jb->highest_wrote_ts) > (UINT_MAX - 1000) && ntohl(node->packet.header.ts) < 1000))) { + jb->complete_frames++; + jb_debug(jb, 2, "WRITE frame ts: %u complete=%u/%u n:%u\n", ntohl(node->packet.header.ts), jb->complete_frames , jb->frame_len, jb->visible_nodes); jb->highest_wrote_ts = packet->header.ts; //verify_oldest_frame(jb); } else if (!jb->write_init) { jb->highest_wrote_ts = packet->header.ts; } - - jb->complete_frames++; - jb_debug(jb, 2, "WRITE frame ts: %u complete=%u/%u n:%u\n", ntohl(node->packet.header.ts), jb->complete_frames , jb->frame_len, jb->visible_nodes); - } else { - - jb_debug(jb, 2, "WRITE frame ts: %u complete=%u/%u n:%u\n", ntohl(node->packet.header.ts), jb->complete_frames , jb->frame_len, jb->visible_nodes); - jb->complete_frames++; - - if (!jb->write_init) { + if (jb->write_init) { + jb_debug(jb, 2, "WRITE frame ts: %u complete=%u/%u n:%u\n", ntohl(node->packet.header.ts), jb->complete_frames , jb->frame_len, jb->visible_nodes); + jb->complete_frames++; + } else { jb->highest_wrote_ts = packet->header.ts; } } @@ -1272,12 +1269,10 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp (ntohs(jb->highest_read_seq) > USHRT_MAX - 10 && ntohs(node->packet.header.seq) <= 10) ) { jb->highest_read_seq = node->packet.header.seq; } - - jb->complete_frames--; - jb_debug(jb, 2, "READ frame ts: %u complete=%u/%u n:%u\n", ntohl(node->packet.header.ts), jb->complete_frames , jb->frame_len, jb->visible_nodes); - if (jb->read_init && htons(node->packet.header.seq) >= htons(jb->highest_read_seq) && (ntohl(node->packet.header.ts) > ntohl(jb->highest_read_ts))) { + jb->complete_frames--; + jb_debug(jb, 2, "READ frame ts: %u complete=%u/%u n:%u\n", ntohl(node->packet.header.ts), jb->complete_frames , jb->frame_len, jb->visible_nodes); jb->highest_read_ts = node->packet.header.ts; } else if (!jb->read_init) { jb->highest_read_ts = node->packet.header.ts; diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 0649be6c2d..bf485f4c3e 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -5802,7 +5802,7 @@ static void handle_nack(switch_rtp_t *rtp_session, uint32_t nack) send_msg->header.pt, ntohl(send_msg->header.ts), ntohs(send_msg->header.seq), send_msg->header.m); } - //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "RE----SEND %u\n", ntohs(send_msg->header.seq)); + //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "RE----SEND %u\n", ntohs(send_msg->header.seq)); switch_rtp_write_raw(rtp_session, (void *) send_msg, &bytes, SWITCH_FALSE); } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG1, "Cannot send NACK for seq %u\n", ntohs(seq)); @@ -5826,7 +5826,7 @@ static void handle_nack(switch_rtp_t *rtp_session, uint32_t nack) send_msg->header.pt, ntohl(send_msg->header.ts), ntohs(send_msg->header.seq), send_msg->header.m); } - //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "RE----SEND %u\n", ntohs(send_msg->header.seq)); + //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "RE----SEND %u\n", ntohs(send_msg->header.seq)); switch_rtp_write_raw(rtp_session, (void *) &send_msg, &bytes, SWITCH_FALSE); } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG1, "Cannot send NACK for seq %u\n", ntohs(seq) + i);