Re-unified coding style.
This commit is contained in:
parent
fd1c2ff2f4
commit
14ba7f835a
4 changed files with 16 additions and 12 deletions
|
@ -298,7 +298,8 @@ int main(int argc, char ** argv){
|
|||
if (Request.isMember("vod")){
|
||||
std::string thisfile = Request["vod"]["filename"];
|
||||
for (JSON::ObjIter oit = Controller::Storage["streams"].ObjBegin(); oit != Controller::Storage["streams"].ObjEnd(); ++oit){
|
||||
if ((oit->second.isMember("source") && oit->second["source"].asString() == thisfile) || (oit->second.isMember("channel") && oit->second["channel"]["URL"].asString() == thisfile)){
|
||||
if ((oit->second.isMember("source") && oit->second["source"].asString() == thisfile)
|
||||
|| (oit->second.isMember("channel") && oit->second["channel"]["URL"].asString() == thisfile)){
|
||||
Controller::lastBuffer[oit->first] = Util::epoch();
|
||||
if (Request["vod"].isMember("meta")){
|
||||
Controller::Storage["streams"][oit->first]["meta"] = Request["vod"]["meta"];
|
||||
|
|
|
@ -9,8 +9,8 @@ namespace Controller {
|
|||
|
||||
std::map<std::string, int> lastBuffer; ///< Last moment of contact with all buffers.
|
||||
|
||||
bool streamsEqual(JSON::Value & one, JSON::Value & two){
|
||||
if (!one.isMember("source") || !two.isMember("source") || one["source"] != two["source"]){
|
||||
bool streamsEqual(JSON::Value & one, JSON::Value & two){
|
||||
if ( !one.isMember("source") || !two.isMember("source") || one["source"] != two["source"]){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -82,7 +82,8 @@ namespace Controller {
|
|||
startStream(jit->first, jit->second);
|
||||
}
|
||||
if (currTime - lastBuffer[jit->first] > 5){
|
||||
if (jit->second.isMember("source") && jit->second["source"].asString().substr(0, 1) == "/" && jit->second.isMember("error") && jit->second["error"].asString() == "Available"){
|
||||
if (jit->second.isMember("source") && jit->second["source"].asString().substr(0, 1) == "/" && jit->second.isMember("error")
|
||||
&& jit->second["error"].asString() == "Available"){
|
||||
jit->second["online"] = 2;
|
||||
}else{
|
||||
if (jit->second.isMember("error") && jit->second["error"].asString() == "Available"){
|
||||
|
@ -95,7 +96,7 @@ namespace Controller {
|
|||
jit->second.removeMember("error");
|
||||
jit->second["online"] = 1;
|
||||
// check if source is valid
|
||||
if ( jit->second.isMember("live") && !jit->second.isMember("meta") || !jit->second["meta"]){
|
||||
if (jit->second.isMember("live") && !jit->second.isMember("meta") || !jit->second["meta"]){
|
||||
jit->second["online"] = 0;
|
||||
jit->second["error"] = "No (valid) source connected";
|
||||
}else{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue