提交 8a8fcbf5 authored 作者: blu's avatar blu

init

上级 45d16c24
...@@ -118,10 +118,21 @@ private: ...@@ -118,10 +118,21 @@ private:
{ {
if(pSub != NULL) { if(pSub != NULL) {
zmq_close(pSub); zmq_close(pSub);
pSub = NULL;
} }
if(pSub != NULL) { if(pSubCtx != NULL) {
zmq_ctx_destroy(pSubCtx);
pSubCtx = NULL;
}
if(pReq != NULL) {
zmq_close(pSub);
pReq = NULL;
}
if(pReqCtx != NULL) {
zmq_ctx_destroy(pSub); zmq_ctx_destroy(pSub);
pReqCtx = NULL;
} }
return 0; return 0;
} }
...@@ -151,6 +162,18 @@ private: ...@@ -151,6 +162,18 @@ private:
pAVFormatInput = (AVFormatContext *)malloc(sizeof(AVFormatContext)); pAVFormatInput = (AVFormatContext *)malloc(sizeof(AVFormatContext));
AVFormatCtxSerializer::decode((char *)zmq_msg_data(&msg), ret, pAVFormatInput); AVFormatCtxSerializer::decode((char *)zmq_msg_data(&msg), ret, pAVFormatInput);
// close req
{
if(pReq != NULL) {
zmq_close(pSub);
pReq = NULL;
}
if(pReqCtx != NULL) {
zmq_ctx_destroy(pSub);
pReqCtx = NULL;
}
}
ret = avformat_alloc_output_context2(&pAVFormatRemux, NULL, "rtsp", urlOut.c_str()); ret = avformat_alloc_output_context2(&pAVFormatRemux, NULL, "rtsp", urlOut.c_str());
if (ret < 0) { if (ret < 0) {
spdlog::error("evpusher {} {} failed create avformatcontext for output: %s", sn, iid, av_err2str(ret)); spdlog::error("evpusher {} {} failed create avformatcontext for output: %s", sn, iid, av_err2str(ret));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论