git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4751 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-03-23 16:34:13 +00:00
parent 318dc8b4e5
commit 3b84b53819
1 changed files with 39 additions and 29 deletions

View File

@ -735,7 +735,7 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
if (conference->fnode->leadin) { if (conference->fnode->leadin) {
conference->fnode->leadin--; conference->fnode->leadin--;
} else { } else {
ready++; file_sample_len = samples;
if (conference->fnode->type == NODE_TYPE_SPEECH) { if (conference->fnode->type == NODE_TYPE_SPEECH) {
switch_speech_flag_t flags = SWITCH_SPEECH_FLAG_BLOCKING; switch_speech_flag_t flags = SWITCH_SPEECH_FLAG_BLOCKING;
uint32_t rate = conference->rate; uint32_t rate = conference->rate;
@ -758,13 +758,18 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
} }
} }
has_file_data = 1; has_file_data = 1;
ready++;
} else { } else {
has_file_data = 0; has_file_data = 0;
} }
if (conference->async_fnode) { if (conference->async_fnode) {
/* Lead in time */
if (conference->async_fnode->leadin) {
conference->async_fnode->leadin--;
} else {
file_sample_len = samples;
switch_core_file_read(&conference->async_fnode->fh, async_file_frame, &file_sample_len); switch_core_file_read(&conference->async_fnode->fh, async_file_frame, &file_sample_len);
if (file_sample_len <= 0) { if (file_sample_len <= 0) {
conference->async_fnode->done++; conference->async_fnode->done++;
} else { } else {
@ -783,9 +788,10 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
} else { } else {
memcpy(file_frame, async_file_frame, file_sample_len * 2); memcpy(file_frame, async_file_frame, file_sample_len * 2);
has_file_data = 1; has_file_data = 1;
ready++;
}
} }
} }
} }
if (ready) { if (ready) {
@ -1958,7 +1964,7 @@ static switch_status_t conference_play_file(conference_obj_t *conference, char *
} }
} }
if (!strncasecmp(file, "say:", 4)) { if (!async && !strncasecmp(file, "say:", 4)) {
status = conference_say(conference, file + 4, leadin); status = conference_say(conference, file + 4, leadin);
goto done; goto done;
} }
@ -1969,9 +1975,11 @@ static switch_status_t conference_play_file(conference_obj_t *conference, char *
goto done; goto done;
} }
file = dfile; file = dfile;
} else { } else if (!async) {
status = conference_say(conference, file, leadin); status = conference_say(conference, file, leadin);
goto done; goto done;
} else {
goto done;
} }
} }
@ -2017,8 +2025,10 @@ static switch_status_t conference_play_file(conference_obj_t *conference, char *
conference->async_fnode = fnode; conference->async_fnode = fnode;
if (nptr) { if (nptr) {
switch_speech_flag_t flags = SWITCH_SPEECH_FLAG_NONE; switch_memory_pool_t *pool;
switch_core_speech_close(&conference->fnode->sh, &flags); switch_core_file_close(&nptr->fh);
pool = nptr->pool;
switch_core_destroy_memory_pool(&pool);
} }
} else { } else {