]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
allow enable_file_write_buffering to alternatively allow you to set the exact size...
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 21 Feb 2012 16:51:18 +0000 (10:51 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 21 Feb 2012 16:51:18 +0000 (10:51 -0600)
src/switch_ivr_async.c

index 1620086e62332052e4f1fabdfbdea03f5e73a559..6e3385ff231e82276909d18c6917bea1a9535f91 100644 (file)
@@ -1639,10 +1639,19 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t
 
        fh->channels = channels;
 
-       vval = switch_channel_get_variable(channel, "enable_file_write_buffering");
-       if (!vval || switch_true(vval)) {
+       if ((vval = switch_channel_get_variable(channel, "enable_file_write_buffering"))) {
+               int tmp = atoi(vval);
+               
+               if (tmp > 0) {
+                       fh->pre_buffer_datalen = tmp;
+               } else if (switch_true(vval)) {
+                       fh->pre_buffer_datalen = SWITCH_DEFAULT_FILE_BUFFER_LEN;
+               }
+
+       } else {
                fh->pre_buffer_datalen = SWITCH_DEFAULT_FILE_BUFFER_LEN;
        }
+
        
        if (!switch_is_file_path(file)) {
                char *tfile = NULL;