Fixed support for inputs with URL parameters
This commit is contained in:
parent
45b245ad4e
commit
9a1b4fb872
1 changed files with 7 additions and 6 deletions
|
@ -288,6 +288,8 @@ bool Util::startInput(std::string streamname, std::string filename, bool forkFir
|
||||||
}
|
}
|
||||||
|
|
||||||
JSON::Value Util::getInputBySource(const std::string &filename, bool isProvider){
|
JSON::Value Util::getInputBySource(const std::string &filename, bool isProvider){
|
||||||
|
std::string tmpFn = filename;
|
||||||
|
if (tmpFn.find('?') != std::string::npos){tmpFn.erase(tmpFn.find('?'), std::string::npos);}
|
||||||
JSON::Value ret;
|
JSON::Value ret;
|
||||||
|
|
||||||
// Attempt to load up configuration and find this stream
|
// Attempt to load up configuration and find this stream
|
||||||
|
@ -318,8 +320,8 @@ JSON::Value Util::getInputBySource(const std::string &filename, bool isProvider)
|
||||||
MEDIUM_MSG("Checking input %s: %s (%s)", inputs.getIndiceName(i).c_str(),
|
MEDIUM_MSG("Checking input %s: %s (%s)", inputs.getIndiceName(i).c_str(),
|
||||||
tmp_input.getMember("name").asString().c_str(), source.c_str());
|
tmp_input.getMember("name").asString().c_str(), source.c_str());
|
||||||
|
|
||||||
if (filename.substr(0, front.size()) == front &&
|
if (tmpFn.substr(0, front.size()) == front &&
|
||||||
filename.substr(filename.size() - back.size()) == back){
|
tmpFn.substr(tmpFn.size() - back.size()) == back){
|
||||||
if (tmp_input.getMember("non-provider") && !isProvider){
|
if (tmp_input.getMember("non-provider") && !isProvider){
|
||||||
noProviderNoPick = true;
|
noProviderNoPick = true;
|
||||||
continue;
|
continue;
|
||||||
|
@ -336,8 +338,7 @@ JSON::Value Util::getInputBySource(const std::string &filename, bool isProvider)
|
||||||
MEDIUM_MSG("Checking input %s: %s (%s)", inputs.getIndiceName(i).c_str(),
|
MEDIUM_MSG("Checking input %s: %s (%s)", inputs.getIndiceName(i).c_str(),
|
||||||
tmp_input.getMember("name").asString().c_str(), source.c_str());
|
tmp_input.getMember("name").asString().c_str(), source.c_str());
|
||||||
|
|
||||||
if (filename.substr(0, front.size()) == front &&
|
if (tmpFn.substr(0, front.size()) == front && tmpFn.substr(tmpFn.size() - back.size()) == back){
|
||||||
filename.substr(filename.size() - back.size()) == back){
|
|
||||||
if (tmp_input.getMember("non-provider") && !isProvider){
|
if (tmp_input.getMember("non-provider") && !isProvider){
|
||||||
noProviderNoPick = true;
|
noProviderNoPick = true;
|
||||||
continue;
|
continue;
|
||||||
|
@ -351,9 +352,9 @@ JSON::Value Util::getInputBySource(const std::string &filename, bool isProvider)
|
||||||
}
|
}
|
||||||
if (!selected){
|
if (!selected){
|
||||||
if (noProviderNoPick){
|
if (noProviderNoPick){
|
||||||
INFO_MSG("Not a media provider for input: %s", filename.c_str());
|
INFO_MSG("Not a media provider for input: %s", tmpFn.c_str());
|
||||||
}else{
|
}else{
|
||||||
FAIL_MSG("No compatible input found for: %s", filename.c_str());
|
FAIL_MSG("No compatible input found for: %s", tmpFn.c_str());
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
ret = input.asJSON();
|
ret = input.asJSON();
|
||||||
|
|
Loading…
Add table
Reference in a new issue