FS-7519: increase default video buffer to 2mb in avformat and add vbuf file param to change it per file using a number of bytes with k or m modifier for kilobytes and megabytes

This commit is contained in:
Anthony Minessale authored and Michael Jerris committed 2015-05-28 12:47:20 -05:00
1 parent cbe4f10ba3
commit dd3d6cbe76
3 files changed
+28 -1

No files matched your search

+16
View File
@@ -157,6 +157,22 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
fh->mm.fps = ftmp;
}
}
if ((val = switch_event_get_header(fh->params, "vbuf"))) {
tmp = atoi(val);
if (strrchr(val, 'k')) {
tmp *= 1024;
} else if (strrchr(val, 'm')) {
tmp *= 1048576;
}
if (tmp > 0 && tmp < 52428800 /*50mb*/) {
fh->mm.vbuf = tmp;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid buffer size: %d\n", tmp);
}
}
}
if (switch_directory_exists(file_path, fh->memory_pool) == SWITCH_STATUS_SUCCESS) {