From a3d696d805ba6da1bf1c9a9929a59dff5fdae75c Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Wed, 23 Feb 2022 17:06:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=88=A4=E5=AE=9Affmpeg?= =?UTF-8?q?=E6=88=AA=E5=9B=BE=E6=98=AF=E5=90=A6=E4=B8=BA=E7=A9=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/WebApi.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/WebApi.cpp b/server/WebApi.cpp index e5b2dc55..49b0ed5d 100755 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -1253,9 +1253,8 @@ void installWebApi() { const HttpSession::KeyValue &headerIn, const HttpSession::HttpResponseInvoker &invoker) { StrCaseMap headerOut; - struct stat statbuf = {0}; GET_CONFIG(string, defaultSnap, API::kDefaultSnap); - if (!(stat(snap_path.data(), &statbuf) == 0 && statbuf.st_size != 0) && !defaultSnap.empty()) { + if (!File::fileSize(snap_path.data()) && !defaultSnap.empty()) { //空文件且设置了预设图,则返回预设图片(也就是FFmpeg生成截图中空档期的默认图片) const_cast(snap_path) = File::absolutePath(defaultSnap, ""); headerOut["Content-Type"] = HttpFileManager::getContentType(snap_path.data());