修复流注册事件track和regist字段缺失的bug

This commit is contained in:
xiongziliang 2021-04-11 11:39:49 +08:00
parent 67e1b1f194
commit 271b180004
2 changed files with 3 additions and 2 deletions

View File

@ -272,7 +272,7 @@ Value makeMediaSourceJson(MediaSource &media){
item["originSock"] = Json::nullValue;
}
for(auto &track : media.getTracks()){
for(auto &track : media.getTracks(false)){
Value obj;
auto codec_type = track->getTrackType();
obj["codec_id"] = track->getCodecId();

View File

@ -301,14 +301,15 @@ void installWebHook(){
return;
}
ArgsType body;
body["regist"] = bRegist;
if (bRegist) {
body = makeMediaSourceJson(sender);
body["regist"] = bRegist;
} else {
body["schema"] = sender.getSchema();
body["vhost"] = sender.getVhost();
body["app"] = sender.getApp();
body["stream"] = sender.getId();
body["regist"] = bRegist;
}
//执行hook
do_http_hook(hook_stream_chaned,body, nullptr);