mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 20:27:34 +08:00
修复cpu亲和性设置导致FFmpeg进程不能使用多核cpu的问题:#1149
This commit is contained in:
parent
d2a9878557
commit
daaf73d390
@ -75,6 +75,8 @@ void Process::run(const string &cmd, const string &log_file_tmp) {
|
|||||||
throw std::runtime_error(StrPrinter << "fork child process failed,err:" << get_uv_errmsg());
|
throw std::runtime_error(StrPrinter << "fork child process failed,err:" << get_uv_errmsg());
|
||||||
}
|
}
|
||||||
if (_pid == 0) {
|
if (_pid == 0) {
|
||||||
|
//取消cpu亲和性设置,防止FFmpeg进程cpu占用率不能超过100%的问题
|
||||||
|
setThreadAffinity(-1);
|
||||||
string log_file;
|
string log_file;
|
||||||
if (log_file_tmp.empty()) {
|
if (log_file_tmp.empty()) {
|
||||||
//未指定子进程日志文件时,重定向至/dev/null
|
//未指定子进程日志文件时,重定向至/dev/null
|
||||||
|
Loading…
Reference in New Issue
Block a user