[commit] r4150 - in freeswitch/trunk/src: . mod/applications/mod_conference mod/timers/mod_softtimer
Author: anthm Date: Wed Feb 7 14:01:07 2007 New Revision: 4150 Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c freeswitch/trunk/src/mod/timers/mod_softtimer/mod_softtimer.c freeswitch/trunk/src/switch_rtp.c Log: timer mojo (cont) Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (original) +++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Wed Feb 7 14:01:07 2007 @@ -510,13 +510,13 @@ // anounce the total number of members in the conference if (conference->count >= conference->anounce_count && conference->anounce_count > 1) { snprintf(msg, sizeof(msg), "There are %d callers", conference->count); - conference_member_say(member, msg, 0); + conference_member_say(member, msg, CONF_DEFAULT_LEADIN); } else if (conference->count == 1) { if (conference->alone_sound) { - conference_play_file(conference, conference->alone_sound, 0, switch_core_session_get_channel(member->session)); + conference_play_file(conference, conference->alone_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session)); } else { snprintf(msg, sizeof(msg), "You are currently the only person in this conference.", conference->count); - conference_member_say(member, msg, 0); + conference_member_say(member, msg, CONF_DEFAULT_LEADIN); } } @@ -1555,6 +1555,7 @@ /* handle file and TTS frames */ if (member->fnode) { + switch_mutex_lock(member->flag_mutex); /* if we are done, clean it up */ if (member->fnode->done) { conference_file_node_t *fnode; @@ -1567,15 +1568,13 @@ switch_core_file_close(&member->fnode->fh); } - switch_mutex_lock(member->flag_mutex); + fnode = member->fnode; member->fnode = member->fnode->next; - switch_mutex_unlock(member->flag_mutex); pool = fnode->pool; fnode = NULL; switch_core_destroy_memory_pool(&pool); - } else { /* skip this frame until leadin time has expired */ if (member->fnode->leadin) { @@ -1618,6 +1617,7 @@ } } } + switch_mutex_unlock(member->flag_mutex); } else { /* send the conferecne frame to the call leg */ switch_buffer_t *use_buffer = NULL; uint32_t mux_used = (uint32_t)switch_buffer_inuse(member->mux_buffer); @@ -2055,6 +2055,7 @@ fnode->type = NODE_TYPE_SPEECH; fnode->leadin = leadin; + fnode->pool = pool; memset(&fnode->sh, 0, sizeof(fnode->sh)); if (switch_core_speech_open(&fnode->sh, @@ -2062,13 +2063,11 @@ conference->tts_voice, conference->rate, &flags, - conference->pool) != SWITCH_STATUS_SUCCESS) { + fnode->pool) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid TTS module [%s]!\n", conference->tts_engine); return SWITCH_STATUS_FALSE; } - fnode->pool = pool; - /* Queue the node */ switch_mutex_lock(member->flag_mutex); for (nptr = member->fnode; nptr && nptr->next; nptr = nptr->next); Modified: freeswitch/trunk/src/mod/timers/mod_softtimer/mod_softtimer.c ============================================================================== --- freeswitch/trunk/src/mod/timers/mod_softtimer/mod_softtimer.c (original) +++ freeswitch/trunk/src/mod/timers/mod_softtimer/mod_softtimer.c Wed Feb 7 14:01:07 2007 @@ -95,7 +95,13 @@ uint64_t diff; if ((diff = (private_info->reference - TIMER_MATRIX[timer->interval].tick))) { - switch_yield(diff * 1000); + if (diff == timer->interval) { + switch_yield(diff * 500); + } else { + switch_yield(1000); + } + } else { + break; } } timer->samplecount += timer->samples; Modified: freeswitch/trunk/src/switch_rtp.c ============================================================================== --- freeswitch/trunk/src/switch_rtp.c (original) +++ freeswitch/trunk/src/switch_rtp.c Wed Feb 7 14:01:07 2007 @@ -781,8 +781,7 @@ if (status == SWITCH_STATUS_BREAK || bytes == 0) { if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_DATAWAIT)) { - - switch_yield(diff * 1000); + switch_yield(diff * 500); continue; } return 0;
participants (1)
-
Freeswitch SVN