From: Anthony Minessale Date: Tue, 21 Feb 2012 16:51:18 +0000 (-0600) Subject: allow enable_file_write_buffering to alternatively allow you to set the exact size... X-Git-Tag: v1.2-rc1~19^2^2~68^2~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25dd668af269ed9221556f155feb4dd9c0e223ad;p=thirdparty%2Ffreeswitch.git allow enable_file_write_buffering to alternatively allow you to set the exact size of the pre buffer --- diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index 1620086e62..6e3385ff23 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -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;