This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "". The branch, master has been updated via 45b3adda57a9281d0dd4389884d2a42eebc7dbba (commit) from 52bf0423e2231e7e16126baa13b8fef14132ac57 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 45b3adda57a9281d0dd4389884d2a42eebc7dbba Author: Anthony Minessale <anthm@freeswitch.org> Date: Tue Feb 1 11:43:02 2011 -0600 revert 02d1af647bac6b937de02608d53ea1831f51b968 diff --git a/src/mod/endpoints/mod_loopback/mod_loopback.c b/src/mod/endpoints/mod_loopback/mod_loopback.c index aa57668..f875f6b 100644 --- a/src/mod/endpoints/mod_loopback/mod_loopback.c +++ b/src/mod/endpoints/mod_loopback/mod_loopback.c @@ -77,11 +77,11 @@ struct private_object { switch_frame_t cng_frame; unsigned char cng_databuf[SWITCH_RECOMMENDED_BUFFER_SIZE]; + switch_timer_t timer; switch_caller_profile_t *caller_profile; int32_t bowout_frame_count; char *other_uuid; switch_queue_t *frame_queue; - switch_codec_implementation_t read_impl; }; typedef struct private_object private_t; @@ -111,6 +111,7 @@ static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *ses int interval = 20; switch_status_t status = SWITCH_STATUS_SUCCESS; switch_channel_t *channel = switch_core_session_get_channel(session); + const switch_codec_implementation_t *read_impl; if (codec) { iananame = codec->implementation->iananame; @@ -165,7 +166,15 @@ static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *ses switch_core_session_set_read_codec(session, &tech_pvt->read_codec); switch_core_session_set_write_codec(session, &tech_pvt->write_codec); - tech_pvt->read_impl = *tech_pvt->read_codec.implementation; + if (tech_pvt->flag_mutex) { + switch_core_timer_destroy(&tech_pvt->timer); + } + + read_impl = tech_pvt->read_codec.implementation; + + switch_core_timer_init(&tech_pvt->timer, "soft", + read_impl->microseconds_per_packet / 1000, read_impl->samples_per_packet * 4, switch_core_session_get_pool(session)); + if (!tech_pvt->flag_mutex) { switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session)); @@ -367,6 +376,7 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session) tech_pvt = switch_core_session_get_private(session); if (tech_pvt) { + switch_core_timer_destroy(&tech_pvt->timer); if (switch_core_codec_ready(&tech_pvt->read_codec)) { switch_core_codec_destroy(&tech_pvt->read_codec); @@ -558,10 +568,12 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch goto end; } - mutex = tech_pvt->mutex; + switch_core_timer_next(&tech_pvt->timer); + mutex = tech_pvt->mutex; + switch_mutex_lock(mutex); - if (switch_queue_pop_timeout(tech_pvt->frame_queue, &pop, tech_pvt->read_impl.microseconds_per_packet) == SWITCH_STATUS_SUCCESS && pop) { + if (switch_queue_trypop(tech_pvt->frame_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) { if (tech_pvt->write_frame) { switch_frame_free(&tech_pvt->write_frame); } @@ -573,8 +585,6 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch switch_set_flag(tech_pvt, TFLAG_CNG); } - switch_mutex_lock(mutex); - if (switch_test_flag(tech_pvt, TFLAG_CNG)) { unsigned char data[SWITCH_RECOMMENDED_BUFFER_SIZE]; uint32_t flag = 0; @@ -765,6 +775,8 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s switch_frame_free(&frame); } + switch_core_timer_sync(&tech_pvt->timer); + } break; default: ----------------------------------------------------------------------- Summary of changes: src/mod/endpoints/mod_loopback/mod_loopback.c | 24 ++++++++++++++++++------ 1 files changed, 18 insertions(+), 6 deletions(-) hooks/post-receive --