From b4e8be56e62b559259121fdc988026224312ecc9 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 15 Nov 2016 10:25:25 -0600 Subject: [PATCH] FS-9708 --- src/switch_core_media.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 037f3218b9..f246d82a09 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -6269,7 +6269,6 @@ static void *SWITCH_THREAD_FUNC audio_write_thread(switch_thread_t *thread, void switch_frame_buffer_create(&a_engine->write_fb, 500); - while(switch_channel_up_nosig(session->channel) && mh->up == 1) { void *pop; @@ -6283,6 +6282,8 @@ static void *SWITCH_THREAD_FUNC audio_write_thread(switch_thread_t *thread, void write_impl.samples_per_packet, switch_core_session_get_pool(session)); } + + switch_core_timer_next(&timer); if (switch_frame_buffer_trypop(a_engine->write_fb, &pop) == SWITCH_STATUS_SUCCESS && pop) { switch_frame_t *frame = (switch_frame_t *)pop; @@ -6294,9 +6295,6 @@ static void *SWITCH_THREAD_FUNC audio_write_thread(switch_thread_t *thread, void perform_write(session, frame, SWITCH_IO_FLAG_QUEUED, 0); switch_frame_buffer_free(a_engine->write_fb, &frame); } - - switch_core_timer_next(&timer); - } switch_mutex_lock(smh->control_mutex);