修复编译问题

This commit is contained in:
xiongziliang 2022-01-14 22:04:46 +08:00
parent e8b0993493
commit c9d755f4e8
2 changed files with 5 additions and 9 deletions

@ -1 +1 @@
Subproject commit dd101bcc31290e3d1ec1ae939d937f2712719a0d
Subproject commit a71747c7d0811263b12ef9112ec13fdffe2ab171

View File

@ -1025,24 +1025,20 @@ void installWebApi() {
api_regist("/index/api/openRtpServer",[](API_ARGS_MAP){
CHECK_SECRET();
CHECK_ARGS("port", "enable_tcp", "stream_id");
bool enable_reuse=true;
if(!allArgs["enable_reuse"].empty()){
bool enable_reuse = true;
if (!allArgs["enable_reuse"].empty()) {
enable_reuse = allArgs["enable_reuse"].as<bool>();
}
auto stream_id = allArgs["stream_id"];
lock_guard<recursive_mutex> lck(s_rtpServerMapMtx);
if(s_rtpServerMap.find(stream_id) != s_rtpServerMap.end()) {
if (s_rtpServerMap.find(stream_id) != s_rtpServerMap.end()) {
//为了防止RtpProcess所有权限混乱的问题不允许重复添加相同的stream_id
throw InvalidArgsException("该stream_id已存在");
}
RtpServer::Ptr server = std::make_shared<RtpServer>();
server->start(allArgs["port"], stream_id, allArgs["enable_tcp"].as<bool>(),"0.0.0.0",enable_reuse);
server->start(allArgs["port"], stream_id, allArgs["enable_tcp"].as<bool>(), "0.0.0.0", enable_reuse);
server->setOnDetach([stream_id]() {
//设置rtp超时移除事件
lock_guard<recursive_mutex> lck(s_rtpServerMapMtx);