This commit is contained in:
Anthony Minessale 2017-03-03 14:33:39 -06:00
parent 1458cfec1c
commit e79157efbd
1 changed files with 9 additions and 2 deletions

View File

@ -279,7 +279,7 @@ static inline void hide_node(switch_jb_node_t *node, switch_bool_t pop)
} }
if (switch_core_inthash_delete(jb->node_hash, node->packet.header.seq)) { if (switch_core_inthash_delete(jb->node_hash, node->packet.header.seq)) {
if (jb->type != SJB_VIDEO || node->packet.header.m) { if (node->packet.header.m && jb->type == SJB_VIDEO) {
jb->complete_frames--; jb->complete_frames--;
} }
} }
@ -583,7 +583,9 @@ static inline void add_node(switch_jb_t *jb, switch_rtp_packet_t *packet, switch
switch_core_inthash_insert(jb->node_hash, node->packet.header.seq, node); switch_core_inthash_insert(jb->node_hash, node->packet.header.seq, node);
if (packet->header.m && jb->type == SJB_VIDEO) {
jb->complete_frames++; jb->complete_frames++;
}
if (jb->node_hash_ts) { if (jb->node_hash_ts) {
switch_core_inthash_insert(jb->node_hash_ts, node->packet.header.ts, node); switch_core_inthash_insert(jb->node_hash_ts, node->packet.header.ts, node);
@ -630,6 +632,7 @@ static inline void add_node(switch_jb_t *jb, switch_rtp_packet_t *packet, switch
} else { } else {
if (jb->write_init || jb->type == SJB_TEXT || jb->type == SJB_AUDIO) { if (jb->write_init || jb->type == SJB_TEXT || jb->type == SJB_AUDIO) {
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_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 { } else {
jb->highest_wrote_ts = packet->header.ts; jb->highest_wrote_ts = packet->header.ts;
} }
@ -1295,6 +1298,10 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
if (jb->type == SJB_TEXT || jb->type == SJB_AUDIO || if (jb->type == SJB_TEXT || jb->type == SJB_AUDIO ||
(jb->read_init && htons(node->packet.header.seq) >= htons(jb->highest_read_seq) && (ntohl(node->packet.header.ts) > ntohl(jb->highest_read_ts)))) { (jb->read_init && htons(node->packet.header.seq) >= htons(jb->highest_read_seq) && (ntohl(node->packet.header.ts) > ntohl(jb->highest_read_ts)))) {
if (jb->type == SJB_TEXT || jb->type == SJB_AUDIO) {
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_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; jb->highest_read_ts = node->packet.header.ts;
} else if (!jb->read_init) { } else if (!jb->read_init) {