Fix for correctly passing stream configuration options to MistIn processes
This commit is contained in:
parent
3992355a74
commit
3736d28eed
1 changed files with 17 additions and 2 deletions
|
@ -194,9 +194,11 @@ bool Util::startInput(std::string streamname, std::string filename, bool forkFir
|
||||||
// check required parameters
|
// check required parameters
|
||||||
if (input.isMember("required")){
|
if (input.isMember("required")){
|
||||||
jsonForEachConst(input["required"], prm){
|
jsonForEachConst(input["required"], prm){
|
||||||
|
if (!prm->isMember("option")){continue;}
|
||||||
const std::string opt = (*prm)["option"].asStringRef();
|
const std::string opt = (*prm)["option"].asStringRef();
|
||||||
// check for overrides
|
// check for overrides
|
||||||
if (overrides.count(opt)){
|
if (overrides.count(opt)){
|
||||||
|
HIGH_MSG("Overriding option '%s' to '%s'", prm.key().c_str(), overrides.at(prm.key()).c_str());
|
||||||
str_args[opt] = overrides.at(opt);
|
str_args[opt] = overrides.at(opt);
|
||||||
}else{
|
}else{
|
||||||
if (!stream_cfg.isMember(prm.key())){
|
if (!stream_cfg.isMember(prm.key())){
|
||||||
|
@ -204,19 +206,32 @@ bool Util::startInput(std::string streamname, std::string filename, bool forkFir
|
||||||
streamname.c_str());
|
streamname.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
str_args[opt] = stream_cfg[opt].asStringRef();
|
if (stream_cfg[prm.key()].isString()){
|
||||||
|
str_args[opt] = stream_cfg[prm.key()].asStringRef();
|
||||||
|
}else{
|
||||||
|
str_args[opt] = stream_cfg[prm.key()].toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check optional parameters
|
// check optional parameters
|
||||||
if (input.isMember("optional")){
|
if (input.isMember("optional")){
|
||||||
jsonForEachConst(input["optional"], prm){
|
jsonForEachConst(input["optional"], prm){
|
||||||
|
if (!prm->isMember("option")){continue;}
|
||||||
const std::string opt = (*prm)["option"].asStringRef();
|
const std::string opt = (*prm)["option"].asStringRef();
|
||||||
// check for overrides
|
// check for overrides
|
||||||
if (overrides.count(opt)){
|
if (overrides.count(opt)){
|
||||||
|
HIGH_MSG("Overriding option '%s' to '%s'", prm.key().c_str(), overrides.at(prm.key()).c_str());
|
||||||
str_args[opt] = overrides.at(opt);
|
str_args[opt] = overrides.at(opt);
|
||||||
}else{
|
}else{
|
||||||
if (stream_cfg.isMember(prm.key())){str_args[opt] = stream_cfg[prm.key()].asStringRef();}
|
if (stream_cfg.isMember(prm.key()) && stream_cfg[prm.key()]){
|
||||||
|
if (stream_cfg[prm.key()].isString()){
|
||||||
|
str_args[opt] = stream_cfg[prm.key()].asStringRef();
|
||||||
|
}else{
|
||||||
|
str_args[opt] = stream_cfg[prm.key()].toString();
|
||||||
|
}
|
||||||
|
INFO_MSG("Setting option '%s' to '%s' = '%s'", opt.c_str(), stream_cfg[prm.key()].toString().c_str(), str_args[opt].c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!prm->isMember("type") && str_args.count(opt)){str_args[opt] = "";}
|
if (!prm->isMember("type") && str_args.count(opt)){str_args[opt] = "";}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue