提交 41edf96f authored 作者: Anthony Minessale's avatar Anthony Minessale

experimental tweaks

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2725 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 1b48735d
...@@ -812,9 +812,9 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f ...@@ -812,9 +812,9 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
size_t bytes = 0, samples = 0, frames = 0, ms = 0; size_t bytes = 0, samples = 0, frames = 0, ms = 0;
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
int payload = 0; int payload = 0;
switch_time_t now, started = switch_time_now(), last_act = switch_time_now(); //switch_time_t now, started = switch_time_now(), last_act = switch_time_now();
unsigned int elapsed; //unsigned int elapsed;
uint32_t hard_timeout = 60000 * 3; //uint32_t hard_timeout = 60000 * 3;
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
assert(channel != NULL); assert(channel != NULL);
...@@ -835,10 +835,12 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f ...@@ -835,10 +835,12 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
ms = tech_pvt->read_codec.implementation->microseconds_per_frame; ms = tech_pvt->read_codec.implementation->microseconds_per_frame;
if (tech_pvt->last_read) { if (tech_pvt->last_read) {
#if 0
elapsed = (unsigned int)((switch_time_now() - tech_pvt->last_read) / 1000); elapsed = (unsigned int)((switch_time_now() - tech_pvt->last_read) / 1000);
if (elapsed > 60000) { if (elapsed > 60000) {
return SWITCH_STATUS_TIMEOUT; return SWITCH_STATUS_TIMEOUT;
} }
#endif
} }
if (switch_test_flag(tech_pvt, TFLAG_IO)) { if (switch_test_flag(tech_pvt, TFLAG_IO)) {
...@@ -853,7 +855,7 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f ...@@ -853,7 +855,7 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
while (!switch_test_flag(tech_pvt, TFLAG_BYE) && switch_test_flag(tech_pvt, TFLAG_IO) && tech_pvt->read_frame.datalen == 0) { while (!switch_test_flag(tech_pvt, TFLAG_BYE) && switch_test_flag(tech_pvt, TFLAG_IO) && tech_pvt->read_frame.datalen == 0) {
now = switch_time_now(); //now = switch_time_now();
tech_pvt->read_frame.flags = SFF_NONE; tech_pvt->read_frame.flags = SFF_NONE;
status = switch_rtp_zerocopy_read_frame(tech_pvt->rtp_session, &tech_pvt->read_frame); status = switch_rtp_zerocopy_read_frame(tech_pvt->rtp_session, &tech_pvt->read_frame);
...@@ -865,7 +867,7 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f ...@@ -865,7 +867,7 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
payload = tech_pvt->read_frame.payload; payload = tech_pvt->read_frame.payload;
#if 0
elapsed = (unsigned int)((switch_time_now() - started) / 1000); elapsed = (unsigned int)((switch_time_now() - started) / 1000);
if (timeout > -1) { if (timeout > -1) {
...@@ -878,7 +880,7 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f ...@@ -878,7 +880,7 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
if (elapsed >= hard_timeout) { if (elapsed >= hard_timeout) {
return SWITCH_STATUS_BREAK; return SWITCH_STATUS_BREAK;
} }
#endif
if (switch_rtp_has_dtmf(tech_pvt->rtp_session)) { if (switch_rtp_has_dtmf(tech_pvt->rtp_session)) {
char dtmf[128]; char dtmf[128];
switch_rtp_dequeue_dtmf(tech_pvt->rtp_session, dtmf, sizeof(dtmf)); switch_rtp_dequeue_dtmf(tech_pvt->rtp_session, dtmf, sizeof(dtmf));
......
...@@ -197,7 +197,8 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void) ...@@ -197,7 +197,8 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
while (switch_time_now() < reference) { while (switch_time_now() < reference) {
//switch_yield((reference - now) - 1000); //switch_yield((reference - now) - 1000);
switch_yield(globals.timer_microseconds >> 1); //switch_yield(globals.timer_microseconds >> 1);
switch_yield(1000);
} }
current_ms += globals.timer_milliseconds; current_ms += globals.timer_milliseconds;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论