mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 06:34:19 +00:00
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:
1 parent
cbe4f10ba3
commit
dd3d6cbe76
3 files changed
+28
-1
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user