Modified: freeswitch/trunk/src/switch_ivr_play_say.c (16991 => 16992)
--- freeswitch/trunk/src/switch_ivr_play_say.c 2010-03-14 23:40:32 UTC (rev 16991)
+++ freeswitch/trunk/src/switch_ivr_play_say.c 2010-03-14 23:54:24 UTC (rev 16992)
@@ -680,11 +680,12 @@
}
}
- 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 @@
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_event_fire(&event);
}
- if (waste_resources) {
+ if (fill_cng || waste_resources) {
switch_core_codec_destroy(&write_codec);
}