From: Anthony Minessale Date: Tue, 5 May 2009 19:35:31 +0000 (+0000) Subject: yipee, ten millionth bug in mod_loopaback X-Git-Tag: v1.0.4~965 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e64147fdb5ebb3c2862c68de3092ca11ae9d04;p=thirdparty%2Ffreeswitch.git yipee, ten millionth bug in mod_loopaback git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13236 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_loopback/mod_loopback.c b/src/mod/endpoints/mod_loopback/mod_loopback.c index 6331cbd708..b47c99f746 100644 --- a/src/mod/endpoints/mod_loopback/mod_loopback.c +++ b/src/mod/endpoints/mod_loopback/mod_loopback.c @@ -542,16 +542,15 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch *frame = NULL; - mutex = tech_pvt->mutex; - switch_mutex_lock(mutex); - - if (!switch_channel_ready(channel)) { goto end; } switch_core_timer_next(&tech_pvt->timer); + mutex = tech_pvt->mutex; + switch_mutex_lock(mutex); + 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);