]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10083: [freeswitch-core] Video audit #resolve
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 3 Mar 2017 00:18:18 +0000 (18:18 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 3 Mar 2017 00:18:18 +0000 (18:18 -0600)
src/switch_jitterbuffer.c
src/switch_rtp.c

index c6787a6bc111b9a2aab29a121c13a41351a14a0f..b5c1e4f793c450aeb9813667d7d8f00060186aca 100644 (file)
@@ -602,7 +602,7 @@ static inline void add_node(switch_jb_t *jb, switch_rtp_packet_t *packet, switch
                        ts_diff = abs((int)((int64_t)ntohl(node->packet.header.ts) - (int64_t)ntohl(jb->highest_wrote_ts)));
                }
 
-               if (((seq_diff >= jb->max_frame_len) || (ts_diff > (900000 * 5)))) {
+               if (((seq_diff >= 100) || (ts_diff > (900000 * 5)))) {
                        jb_debug(jb, 2, "CHANGE DETECTED, PUNT %u\n", abs(((int)ntohs(packet->header.seq) - ntohs(jb->highest_wrote_seq))));
                        switch_jb_reset(jb);
                }
index be8625da757e3593428c4b56c513de45efc6e068..219080cf280ffaf7ad4cc92347db954a532670c1 100644 (file)
@@ -2695,10 +2695,10 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_set_local_address(switch_rtp_t *rtp_s
                goto done;
        }
 
-       if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
-               switch_socket_opt_set(new_sock, SWITCH_SO_RCVBUF, 1572864);
-               switch_socket_opt_set(new_sock, SWITCH_SO_SNDBUF, 1572864);
-       }
+       //if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
+       //switch_socket_opt_set(new_sock, SWITCH_SO_RCVBUF, 1572864);
+               //switch_socket_opt_set(new_sock, SWITCH_SO_SNDBUF, 1572864);
+       //}
 
        if (switch_socket_bind(new_sock, rtp_session->local_addr) != SWITCH_STATUS_SUCCESS) {
                char *em = switch_core_sprintf(rtp_session->pool, "Bind Error! %s:%d", host, port);
@@ -6530,6 +6530,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
        int hot_socket = 0;
        int read_loops = 0;
        int slept = 0;
+       switch_bool_t got_jb = SWITCH_FALSE;
 
        if (!switch_rtp_ready(rtp_session)) {
                return -1;
@@ -6724,8 +6725,13 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
 
                }
 
+               if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
+                       got_jb = (rtp_session->vb && switch_jb_poll(rtp_session->vb));
+               } else {
+                       got_jb = SWITCH_TRUE;
+               }
 
-               if (poll_status == SWITCH_STATUS_SUCCESS || (rtp_session->vb && switch_jb_poll(rtp_session->vb))) {
+               if (poll_status == SWITCH_STATUS_SUCCESS || got_jb) {
 
                        got_rtp_poll = 1;
 
@@ -6733,7 +6739,8 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                                read_pretriggered = 0;
                        } else {
                                
-                               status = read_rtp_packet(rtp_session, &bytes, flags, pmapP, poll_status, SWITCH_TRUE);                          
+                               
+                               status = read_rtp_packet(rtp_session, &bytes, flags, pmapP, poll_status, got_jb);
 
                                if (status == SWITCH_STATUS_GENERR) {
                                        ret = -1;