Commit 75b6ea8934e1943b357e67c0d07ea999c8471d9d

Authored by Hu Chunming
1 parent ca992942

完善mq消息发送

src/reprocessing_module/save_snapshot_reprocessing.cpp
... ... @@ -102,17 +102,21 @@ void save_snapshot_reprocessing::save_img_process() {
102 102 waitforsave_img_queue.pop();
103 103 waitforsave_img_queue_mutex.unlock();
104 104  
105   - bool bSaved = false;
  105 + bool bPost = false;
106 106 if(!cur_image.file_path.empty()){
107   - bSaved = jpegUtil.jpeg_encode(cur_image.img_info.pic_desc, cur_image.file_path);
  107 + bool bSaved = jpegUtil.jpeg_encode(cur_image.img_info.pic_desc, cur_image.file_path);
108 108 if(!bSaved){
109 109 LOG_ERROR("jpeg_encode failed");
  110 + } else {
  111 + bPost = true;
110 112 }
  113 + } else {
  114 + bPost = true;
111 115 }
112 116 VPCUtil::vpc_img_release(cur_image.img_info);
113 117  
114 118 #ifdef POST_USE_RABBITMQ
115   - if (bSaved && callback_ != nullptr && cur_image.json_str.length() > 0) {
  119 + if (bPost && callback_ != nullptr && cur_image.json_str.length() > 0) {
116 120 callback_(cur_image.json_str.c_str());
117 121 }
118 122 #endif
... ...