mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-29 14:45:55 +08:00
修复协议转换配置开关不生效的bug
This commit is contained in:
parent
09a2623e1b
commit
5258169a07
@ -211,10 +211,10 @@ void installWebHook(){
|
||||
GET_CONFIG(string,hook_http_access,Hook::kOnHttpAccess);
|
||||
|
||||
NoticeCenter::Instance().addListener(nullptr,Broadcast::kBroadcastMediaPublish,[](BroadcastMediaPublishArgs){
|
||||
GET_CONFIG(bool,toRtxp,General::kPublishToRtxp);
|
||||
GET_CONFIG(bool,toHls,General::kPublishToHls);
|
||||
GET_CONFIG(bool,toMP4,General::kPublishToMP4);
|
||||
if(!hook_enable || args._param_strs == hook_adminparams || hook_publish.empty() || sender.get_peer_ip() == "127.0.0.1"){
|
||||
GET_CONFIG(bool,toRtxp,General::kPublishToRtxp);
|
||||
GET_CONFIG(bool,toHls,General::kPublishToHls);
|
||||
GET_CONFIG(bool,toMP4,General::kPublishToMP4);
|
||||
invoker("",toRtxp,toHls,toMP4);
|
||||
return;
|
||||
}
|
||||
@ -227,24 +227,20 @@ void installWebHook(){
|
||||
do_http_hook(hook_publish,body,[invoker](const Value &obj,const string &err){
|
||||
if(err.empty()){
|
||||
//推流鉴权成功
|
||||
bool enableRtxp = true;
|
||||
bool enableHls = true;
|
||||
bool enableMP4 = false;
|
||||
|
||||
//兼容用户不传递enableRtxp、enableHls、enableMP4参数
|
||||
if(obj.isMember("enableRtxp")){
|
||||
enableRtxp = obj["enableRtxp"].asBool();
|
||||
toRtxp = obj["enableRtxp"].asBool();
|
||||
}
|
||||
|
||||
if(obj.isMember("enableHls")){
|
||||
enableHls = obj["enableHls"].asBool();
|
||||
toHls = obj["enableHls"].asBool();
|
||||
}
|
||||
|
||||
if(obj.isMember("enableMP4")){
|
||||
enableMP4 = obj["enableMP4"].asBool();
|
||||
toMP4 = obj["enableMP4"].asBool();
|
||||
}
|
||||
|
||||
invoker(err,enableRtxp,enableHls,enableMP4);
|
||||
invoker(err,toRtxp,toHls,toMP4);
|
||||
}else{
|
||||
//推流鉴权失败
|
||||
invoker(err,false, false, false);
|
||||
|
Loading…
Reference in New Issue
Block a user