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;