]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSCORE-571
authorMathieu Rene <mrene@avgs.ca>
Sun, 14 Mar 2010 23:54:24 +0000 (23:54 +0000)
committerMathieu Rene <mrene@avgs.ca>
Sun, 14 Mar 2010 23:54:24 +0000 (23:54 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16992 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_play_say.c

index 7c5d9bb93cee0b5a0fadb3162e220dd8afeb7b96..e822fcbf9ad148617f06fd391e75abf38f3587f8 100644 (file)
@@ -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);
        }