]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7500: ping video thread on shutdown so it can end
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 21 Feb 2015 18:10:34 +0000 (12:10 -0600)
committerMichael Jerris <mike@jerris.com>
Thu, 28 May 2015 17:47:04 +0000 (12:47 -0500)
src/switch_core_media.c
src/switch_core_state_machine.c

index 8d1ea76bf3f177761c7092902dc5f383cb6a9ad3..b52cd04783bb5b59c71424e024457bbb9a2b4f0c 100644 (file)
@@ -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));
index 6034728f21ae4693d9ccbe9f03ed5d7a258d69bd..534da052dd966526bf209c6aafe829d804351e77 100644 (file)
@@ -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);
                                }