fix small problem in speech stuff

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5707 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-09-14 20:00:26 +00:00
parent b961cb2c16
commit 5e0c3ee5b7
3 changed files with 14 additions and 7 deletions

View File

@ -2246,7 +2246,7 @@ static switch_status_t conference_member_say(conference_member_t * member, char
if (!member->sh) {
memset(&member->lsh, 0, sizeof(member->lsh));
if (switch_core_speech_open(&member->lsh, conference->tts_engine, conference->tts_voice,
conference->rate, conference->interval, &flags, fnode->pool) !=
conference->rate, conference->interval, &flags, switch_core_session_get_pool(member->session)) !=
SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid TTS module [%s]!\n", conference->tts_engine);
return SWITCH_STATUS_FALSE;

View File

@ -266,12 +266,13 @@ SWITCH_DECLARE(void) switch_buffer_zero(switch_buffer_t *buffer)
SWITCH_DECLARE(void) switch_buffer_destroy(switch_buffer_t **buffer)
{
if (*buffer && switch_test_flag((*buffer), SWITCH_BUFFER_FLAG_DYNAMIC)) {
free((*buffer)->data);
free(*buffer);
if (buffer && *buffer) {
if ((switch_test_flag((*buffer), SWITCH_BUFFER_FLAG_DYNAMIC))) {
switch_safe_free((*buffer)->data);
free(*buffer);
}
*buffer = NULL;
}
*buffer = NULL;
}
/* For Emacs:

View File

@ -122,5 +122,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_speech_read_tts(switch_speech_handle
SWITCH_DECLARE(switch_status_t) switch_core_speech_close(switch_speech_handle_t *sh, switch_speech_flag_t *flags)
{
return sh->speech_interface->speech_close(sh, flags);
switch_status_t status = sh->speech_interface->speech_close(sh, flags);
if (switch_test_flag(sh, SWITCH_SPEECH_FLAG_FREE_POOL)) {
switch_core_destroy_memory_pool(&sh->memory_pool);
}
return status;
}