提交 04ef1a5e authored 作者: blu's avatar blu

bugfix: check 0 sized file

上级 1cda7ff3
...@@ -976,11 +976,20 @@ public: ...@@ -976,11 +976,20 @@ public:
params["tailOffset"] = to_string(offsetE); params["tailOffset"] = to_string(offsetE);
json fileNames; json fileNames;
string sf; string sf;
bool hasError = false;
for(auto &i: v) { for(auto &i: v) {
string fname = this->urlOut + "/" + i + ".mp4"; string fname = this->urlOut + "/" + i + ".mp4";
if(fs::file_size(fname) == 0) {
spdlog::error("evslicer {} video size is 0: {}. ignore this event: {}", this->selfId, fname, evt);
hasError = true;
break;
}
fileNames.push_back(fname); fileNames.push_back(fname);
sf+="\tfile\t" + fname + "\n"; sf+="\tfile\t" + fname + "\n";
} }
if(hasError) {
continue;
}
spdlog::info("evslicer {} file upload range:({},{}) = ({}, {}), url: {}", selfId, tss, tse, this->videoFileTs2Name(tss), this->videoFileTs2Name(tse), this->videoFileServerApi); spdlog::info("evslicer {} file upload range:({},{}) = ({}, {}), url: {}", selfId, tss, tse, this->videoFileTs2Name(tss), this->videoFileTs2Name(tse), this->videoFileServerApi);
string strResp; string strResp;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论