]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix some delay regressions
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 5 Dec 2012 19:17:50 +0000 (13:17 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 5 Dec 2012 19:17:50 +0000 (13:17 -0600)
src/switch_ivr.c
src/switch_ivr_bridge.c
src/switch_ivr_originate.c
src/switch_rtp.c

index dd5055351cf93d94c9fc00ef7277a4baa3173609..6aa51666348af4fabb2e1243452c6602de9c2f5f 100644 (file)
@@ -640,6 +640,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
                                switch_channel_set_flag(channel, CF_BREAK); 
                        }
                        
+                       switch_channel_audio_sync(channel);
                }
        } else if (cmd_hash == CMD_UNICAST) {
                char *local_ip = switch_event_get_header(event, "local-ip");
@@ -1771,6 +1772,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_
                switch_channel_set_caller_profile(channel, new_profile);
 
                switch_channel_set_state(channel, CS_ROUTING);
+               switch_channel_audio_sync(channel);
 
                msg.message_id = SWITCH_MESSAGE_INDICATE_TRANSFER;
                msg.from = __FILE__;
index b8b04cdbd0bac90f8f1cbf5cbc661558c60a6206..52cc7c6693f8e242b7198b4428f6d43b8b933aac 100644 (file)
@@ -1232,8 +1232,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
        switch_channel_set_flag_recursive(caller_channel, CF_BRIDGE_ORIGINATOR);
        switch_channel_clear_flag(peer_channel, CF_BRIDGE_ORIGINATOR);
 
-       //switch_channel_audio_sync(caller_channel);
-       //switch_channel_audio_sync(peer_channel);
+       switch_channel_audio_sync(caller_channel);
+       switch_channel_audio_sync(peer_channel);
 
        b_leg->session = peer_session;
        switch_copy_string(b_leg->b_uuid, switch_core_session_get_uuid(session), sizeof(b_leg->b_uuid));
index 52d903c79d782a6d86f6bf1240fef6923c0d5907..dc281b5885e70543b83be9e182a0b9462b083dc3 100644 (file)
@@ -3707,11 +3707,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                        switch_cond_next();
                }
 
-               //switch_channel_audio_sync(bchan);
+               switch_channel_audio_sync(bchan);
 
-               //if (caller_channel) {
-               //      switch_channel_audio_sync(caller_channel);
-               //}
+               if (caller_channel) {
+                       switch_channel_audio_sync(caller_channel);
+               }
        }
 
        if (oglobals.session) {
index 652ffb11a941ce3616cd60cf2ee62122899838e6..951edb70b79fe17d98ebeb6cd908185cff0333a8 100644 (file)
@@ -2072,7 +2072,7 @@ SWITCH_DECLARE(switch_rtp_t *) switch_rtp_new(const char *rx_host,
                rtp_session->ready = 2;
                rtp_session->rx_host = switch_core_strdup(rtp_session->pool, rx_host);
                rtp_session->rx_port = rx_port;
-               //switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH);
+               switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH);
        } else {
                switch_rtp_release_port(rx_host, rx_port);
        }
@@ -2763,7 +2763,8 @@ SWITCH_DECLARE(void) rtp_flush_read_buffer(switch_rtp_t *rtp_session, switch_rtp
        
                if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) && 
                        !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) {
-                       
+                       switch_set_flag(rtp_session, SWITCH_RTP_FLAG_FLUSH);
+
                        switch (flush) {
                        case SWITCH_RTP_FLUSH_STICK:
                                switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_STICKY_FLUSH);
@@ -2818,6 +2819,7 @@ static void do_flush(switch_rtp_t *rtp_session)
                        if (switch_rtp_ready(rtp_session)) {
                                bytes = sizeof(rtp_msg_t);
                                switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock_input, 0, (void *) &rtp_session->recv_msg, &bytes);
+                               
                                if (bytes) {
                                        int do_cng = 0;