From ae5899dc884d8d7e1427e45c35e865d7ca51c34b Mon Sep 17 00:00:00 2001
From: miyanhui <dennismi1024@gmail.com>
Date: 星期五, 15 二月 2019 14:56:24 +0800
Subject: [PATCH] 新的方式解决视频不录的问题

---
 QiaoJiaSystem/DataManagerServer/http_configserver.cpp |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/QiaoJiaSystem/DataManagerServer/http_configserver.cpp b/QiaoJiaSystem/DataManagerServer/http_configserver.cpp
index 7d8b08e..54a887b 100644
--- a/QiaoJiaSystem/DataManagerServer/http_configserver.cpp
+++ b/QiaoJiaSystem/DataManagerServer/http_configserver.cpp
@@ -2528,7 +2528,7 @@
             std::string picDate = value["picDate"].asString();
             std::string imgKey = value["imgKey"].asString();
             //鍏煎鏃х増鏈�
-            if(imgKey=="undefined")
+            if(imgKey=="undefined" || imgKey.empty())
             {
                 return getAlarmImageByPicDateAndDevId(picDate,devId,response);
             }   
@@ -2554,7 +2554,7 @@
 
 
 
-std::string devHttpServer_c::getAlarmImageByImageKeyAndDevId(const std::string& devId,const std::string& imgKey,
+std::string devHttpServer_c::getAlarmImageByImageKeyAndDevId(const std::string& imgKey,const std::string& devId,
                                                         PResponse &response)  {
     try {
         if (!devId.empty() && !imgKey.empty()) {
@@ -2644,7 +2644,7 @@
         std::string path;
 
         //鍏煎鏃х増鏈�
-        if(imgKey=="undefined")
+        if(imgKey=="undefined"||imgKey.empty())
         {
             qint64 sub;
             path = getVideoPathByPicDate(picDate,devId,sub);
@@ -2825,7 +2825,7 @@
         auto videoParseResult = VideoName_s_t::fromString(item);
         if (videoParseResult.Valid()) {
             if (videoParseResult.m_startFrameId <= imgSt.m_frameId &&
-                imgSt.m_frameId < videoParseResult.m_endFrameId) {
+                imgSt.m_frameId <= videoParseResult.m_endFrameId) {
                 auto imgTm = AppUtil::ParseFromHypenTimeStr(imgSt.m_timeStamp);
                 auto videoTm = AppUtil::ParseFromHypenTimeStr(videoParseResult.m_timeStamp);
                 if (AppUtil::IsRightAfterLeft(imgTm, videoTm)) {
@@ -2858,10 +2858,10 @@
 }
 
 //鏂扮殑鏍规嵁鍥剧墖鍚嶇О鑾峰彇璺緞鐨勬柟娉�
-std::string devHttpServer_c::getVideoPathByImgKey(const std::string &strImageName, const std::string &camId)
+std::string devHttpServer_c::getVideoPathByImgKey(const std::string &imgKey, const std::string &camId)
 {
-    INFO("GetVideoFor: "<<strImageName<<" CamID:"<<camId);
-    ImageName_s_t imgSt= ImageName_s_t::fromString(strImageName);
+    INFO("GetVideoFor: "<<imgKey<<" CamID:"<<camId);
+    ImageName_s_t imgSt= ImageName_s_t::fromString(imgKey);
 
     struct tm imgTime = AppUtil::ParseFromHypenTimeStr(imgSt.m_timeStamp);
     char curFolder[128]={0};
@@ -2871,7 +2871,7 @@
                                   imgTime.tm_year+1900,imgTime.tm_mon+1,imgTime.tm_mday,imgTime.tm_hour);
     std::string t_FilePath = appConfig.getStringProperty("cutPath");
     std::string videoPath = t_FilePath+"/"+camId+"/"+std::string(curFolder);
-    return GetVideoNameByImgKey(strImageName,videoPath);
+    return GetVideoNameByImgKey(imgKey,videoPath);
 }
 
 

--
Gitblit v1.8.0