From 52e52eb9d13fd07286b2d86f29ee2bc50e7ee9d2 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Sun, 14 Mar 2010 23:54:24 +0000 Subject: [PATCH] FSCORE-571 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16992 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_ivr_play_say.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index 7c5d9bb93c..e822fcbf9a 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -680,11 +680,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se } } - if (fill_cng || waste_resources) { + if (fill_cng) { + switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.samples, fill_cng); + } else if (waste_resources) { switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.samples, waste_resources); } - if (!switch_test_flag(fh, SWITCH_FILE_PAUSE) && !switch_test_flag(read_frame, SFF_CNG)) { int16_t *data = read_frame->data; len = (switch_size_t) asis ? read_frame->datalen : read_frame->datalen / 2; @@ -692,7 +693,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se if (switch_core_file_write(fh, data, &len) != SWITCH_STATUS_SUCCESS) { break; } - } else if (switch_test_flag(read_frame, SFF_CNG)) { + } else if (switch_test_flag(read_frame, SFF_CNG) && fill_cng) { len = write_frame.datalen; if (switch_core_file_write(fh, write_frame.data, &len) != SWITCH_STATUS_SUCCESS) { break; @@ -713,7 +714,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se switch_event_fire(&event); } - if (waste_resources) { + if (fill_cng || waste_resources) { switch_core_codec_destroy(&write_codec); }