Fixed metadata not being loaded before first viewer opens the stream.

This commit is contained in:
Thulinma 2013-08-28 15:19:33 +02:00
parent a8a7a56655
commit 51d0d26a6e

View file

@ -59,7 +59,13 @@ namespace Controller {
data["online"] = 0;
return;
}
cmd1 = "cat " + URL;
if ( !data.isMember("meta") || !data["meta"].isMember("tracks")){
char * tmp_cmd[3] = {0, 0, 0};
std::string mistinfo = Util::getMyPath() + "MistInfo";
tmp_cmd[0] = (char*)mistinfo.c_str();
tmp_cmd[1] = (char*)URL.c_str();
data["meta"] = JSON::fromString(Util::Procs::getOutputOf(tmp_cmd));
}
if (Util::epoch() - lastBuffer[name] > 5){
data["error"] = "Available";
data["online"] = 2;