From: Anthony Minessale Date: Sat, 21 Feb 2015 18:10:34 +0000 (-0600) Subject: FS-7500: ping video thread on shutdown so it can end X-Git-Tag: v1.6.2~614^2~351 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f0f408984320c52b748283edfc9091add41ac15;p=thirdparty%2Ffreeswitch.git FS-7500: ping video thread on shutdown so it can end --- diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 8d1ea76bf3..b52cd04783 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -5311,6 +5311,10 @@ SWITCH_DECLARE(void) switch_core_session_wake_video_thread(switch_core_session_t return; } + if (!v_engine->media_thread) { + return; + } + if (!v_engine->mh.cond_mutex) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Channel %s has no cond?\n", switch_channel_get_name(session->channel)); diff --git a/src/switch_core_state_machine.c b/src/switch_core_state_machine.c index 6034728f21..534da052dd 100644 --- a/src/switch_core_state_machine.c +++ b/src/switch_core_state_machine.c @@ -501,6 +501,9 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session) case CS_HANGUP: /* Deactivate and end the thread */ { switch_core_session_hangup_state(session, SWITCH_TRUE); + if (switch_channel_test_flag(session->channel, CF_VIDEO)) { + switch_core_session_wake_video_thread(session); + } switch_channel_set_state(session->channel, CS_REPORTING); }