From 07ebb73882bb1d23dcfb5f8df094346b7aefac46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=B5=E6=B0=B8=E5=86=AC?= Date: Sun, 23 Aug 2020 09:27:41 +0800 Subject: [PATCH] [core] Make sure end the audio absorbing thread --- src/switch_core.c | 2 +- src/switch_ivr_play_say.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/switch_core.c b/src/switch_core.c index 359265c02f..dc172fc21e 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -500,7 +500,7 @@ static void *SWITCH_THREAD_FUNC switch_core_service_thread(switch_thread_t *thre channel = switch_core_session_get_channel(session); switch_channel_set_flag(channel, CF_SERVICE); - while (switch_channel_test_flag(channel, CF_SERVICE)) { + while (switch_channel_test_flag(channel, CF_SERVICE) && switch_channel_up_nosig(channel)) { if (switch_channel_test_flag(channel, CF_SERVICE_AUDIO)) { switch (switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0)) { diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index 339515faec..11aa68d675 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -1980,7 +1980,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess switch_core_codec_destroy(&codec); } - if (timer.samplecount) { + if (timer_name) { /* End the audio absorbing thread */ switch_core_thread_session_end(session); switch_core_timer_destroy(&timer);