]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix regression from ignoring breaks in video rtp sessions and add a flag to force...
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 12 Sep 2013 16:47:54 +0000 (21:47 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 12 Sep 2013 16:47:54 +0000 (21:47 +0500)
src/include/switch_types.h
src/switch_ivr_bridge.c
src/switch_rtp.c

index 143328cec4d5e40607c8ad1fa8e6919e15f5cb84..9c86e56ae9a1703b65fdbdd41ce3c1e9f813085b 100644 (file)
@@ -1339,6 +1339,7 @@ typedef enum {
        CF_NOVIDEO,
        CF_VIDEO_ECHO,
        CF_SLA_INTERCEPT,
+       CF_VIDEO_BREAK,
        /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
        /* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
        CF_FLAG_MAX
index e0d005aec9cfc505b34427fa06ccd8009b8c0c8b..0927fe95b5b708cb1170affb2cd9a9199a251dc1 100644 (file)
@@ -626,9 +626,13 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
 
                if (vh.up == 1) {
                        vh.up = -1;
-                       switch_core_session_kill_channel(session_a, SWITCH_SIG_BREAK);
-                       switch_core_session_kill_channel(session_b, SWITCH_SIG_BREAK);
                }
+
+               switch_channel_set_flag(chan_a, CF_VIDEO_BREAK);
+               switch_channel_set_flag(chan_b, CF_VIDEO_BREAK);
+               switch_core_session_kill_channel(session_a, SWITCH_SIG_BREAK);
+               switch_core_session_kill_channel(session_b, SWITCH_SIG_BREAK);
+
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "Ending video thread.\n");
                switch_thread_join(&st, vid_thread);
                switch_channel_clear_flag(chan_a, CF_NOT_READY);
index 2cae2d968699e569455f106e34949990df80eaec..a5b091fe17ab0d0ddceb6f19ac2db279485e6811 100644 (file)
@@ -3344,7 +3344,17 @@ SWITCH_DECLARE(void) switch_rtp_break(switch_rtp_t *rtp_session)
        }
 
        if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
-               return;
+               int ret = 1;
+
+               if (rtp_session->session) {
+                       switch_channel_t *channel = switch_core_session_get_channel(rtp_session->session);
+                       if (switch_channel_test_flag(channel, CF_VIDEO_BREAK)) {
+                               switch_channel_clear_flag(channel, CF_VIDEO_BREAK);
+                               ret = 0;
+                       }
+               }
+
+               if (ret) return;
        }
 
        switch_mutex_lock(rtp_session->flag_mutex);
@@ -4612,6 +4622,13 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                        if (rtp_session->dtmf_data.out_digit_dur > 0) {
                                return_cng_frame();
                        }
+
+                       if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO] && rtp_session->flags[SWITCH_RTP_FLAG_BREAK]) {
+                               switch_rtp_clear_flag(rtp_session, SWITCH_RTP_FLAG_BREAK);
+                               bytes = 0;
+                return_cng_frame();
+                       }
+
                }
                
                if (poll_status == SWITCH_STATUS_SUCCESS) {