修复closeRtpServer接口相关bug:#447

This commit is contained in:
xiongziliang 2020-08-08 12:20:44 +08:00
parent f23e117751
commit 461b5da933

View File

@ -788,7 +788,14 @@ void installWebApi() {
CHECK_ARGS("stream_id"); CHECK_ARGS("stream_id");
lock_guard<recursive_mutex> lck(s_rtpServerMapMtx); lock_guard<recursive_mutex> lck(s_rtpServerMapMtx);
val["hit"] = (int) s_rtpServerMap.erase(allArgs["stream_id"]); auto it = s_rtpServerMap.find(allArgs["stream_id"]);
if(it == s_rtpServerMap.end()){
val["hit"] = 0;
return;
}
auto server = it->second;
s_rtpServerMap.erase(it);
val["hit"] = 1;
}); });
api_regist1("/index/api/listRtpServer",[](API_ARGS1){ api_regist1("/index/api/listRtpServer",[](API_ARGS1){