Fix fallback stream, added support for stream variables in fallback stream

This commit is contained in:
Thulinma 2021-10-27 15:39:34 +02:00
parent aa77d86df1
commit f8251cc115
2 changed files with 22 additions and 2 deletions

View file

@ -326,9 +326,12 @@ namespace Mist{
// If stream is configured, use fallback stream setting, if set.
JSON::Value strCnf = Util::getStreamConfig(streamName);
if (strCnf && strCnf["fallback_stream"].asStringRef().size()){
streamName = strCnf["fallback_stream"].asStringRef();
std::string defStrm = strCnf["fallback_stream"].asStringRef();
std::string newStrm = defStrm;
Util::streamVariables(newStrm, streamName, "");
INFO_MSG("Switching to configured fallback stream '%s' -> '%s'", defStrm.c_str(), newStrm.c_str());
streamName = newStrm;
Util::setStreamName(streamName);
INFO_MSG("Switching to configured fallback stream '%s'", streamName.c_str());
reconnect();
return;
}