提交 b6e797c3 authored 作者: blu's avatar blu

revise getModulesOperFromConfDiff and related applications

上级 b89ec6d3
...@@ -154,11 +154,15 @@ private: ...@@ -154,11 +154,15 @@ private:
else if(peerId == pullerGid) { else if(peerId == pullerGid) {
if(metaType == EV_MSG_META_AVFORMATCTX) { if(metaType == EV_MSG_META_AVFORMATCTX) {
lock_guard<mutex> lock(this->mutMsg); lock_guard<mutex> lock(this->mutMsg);
pAVFormatInput = (AVFormatContext *)malloc(sizeof(AVFormatContext)); if(pAVFormatInput == nullptr) {
AVFormatCtxSerializer::decode((char *)(v[2].data()), v[2].size(), pAVFormatInput); pAVFormatInput = (AVFormatContext *)malloc(sizeof(AVFormatContext));
gotFormat = true; AVFormatCtxSerializer::decode((char *)(v[2].data()), v[2].size(), pAVFormatInput);
bProcessed = true; gotFormat = true;
cvMsg.notify_one(); bProcessed = true;
cvMsg.notify_one();
}else{
spdlog::warn("evmlmotion {} received avformatctx msg from {}, but already proceessed before, ignored. TODO: reinit", selfId, peerId);
}
} }
} }
} }
......
...@@ -256,11 +256,16 @@ private: ...@@ -256,11 +256,16 @@ private:
else if(peerId == pullerGid) { else if(peerId == pullerGid) {
if(metaType == EV_MSG_META_AVFORMATCTX) { if(metaType == EV_MSG_META_AVFORMATCTX) {
lock_guard<mutex> lock(this->mutMsg); lock_guard<mutex> lock(this->mutMsg);
pAVFormatInput = (AVFormatContext *)malloc(sizeof(AVFormatContext)); if(pAVFormatInput == nullptr) {
AVFormatCtxSerializer::decode((char *)(v[2].data()), v[2].size(), pAVFormatInput); pAVFormatInput = (AVFormatContext *)malloc(sizeof(AVFormatContext));
gotFormat = true; AVFormatCtxSerializer::decode((char *)(v[2].data()), v[2].size(), pAVFormatInput);
bProcessed = true; gotFormat = true;
cvMsg.notify_one(); bProcessed = true;
cvMsg.notify_one();
}else{
spdlog::warn("evpusher {} received avformatctx msg from {}, but already proceessed before, ignored. TODO: reinit", selfId, peerId);
}
} }
} }
} }
......
...@@ -91,11 +91,15 @@ private: ...@@ -91,11 +91,15 @@ private:
meta = json::parse(body2str(v[1]))["type"]; meta = json::parse(body2str(v[1]))["type"];
if(meta == EV_MSG_META_AVFORMATCTX) { if(meta == EV_MSG_META_AVFORMATCTX) {
lock_guard<mutex> lock(this->mutMsg); lock_guard<mutex> lock(this->mutMsg);
pAVFormatInput = (AVFormatContext *)malloc(sizeof(AVFormatContext)); if(pAVFormatInput == nullptr) {
AVFormatCtxSerializer::decode((char *)(v[2].data()), v[2].size(), pAVFormatInput); pAVFormatInput = (AVFormatContext *)malloc(sizeof(AVFormatContext));
gotFormat = true; AVFormatCtxSerializer::decode((char *)(v[2].data()), v[2].size(), pAVFormatInput);
cvMsg.notify_one(); gotFormat = true;
spdlog::info("evslicer {} got avformat from {}", selfId, peerId); cvMsg.notify_one();
spdlog::info("evslicer {} got avformat from {}", selfId, peerId);
}else{
spdlog::warn("evslicer {} received avformatctx msg from {}, but already proceessed before, ignored. TODO: reinit", selfId, peerId);
}
} }
else if(meta == EV_MSG_META_EVENT) { else if(meta == EV_MSG_META_EVENT) {
data = json::parse(body2str(v[2])); data = json::parse(body2str(v[2]));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论