diff --git a/src/controller/controller_streams.cpp b/src/controller/controller_streams.cpp index 5bec9167..ef6316a5 100644 --- a/src/controller/controller_streams.cpp +++ b/src/controller/controller_streams.cpp @@ -205,18 +205,13 @@ namespace Controller { // for live streams, keep track of activity if (jit->second["meta"].isMember("live")){ static std::map checker; - //check activity by monitoring the lastms of track 0; - JSON::ObjIter trackIt = jit->second["meta"]["tracks"].ObjBegin(); - if (trackIt->second["lastms"].asInt() != checker[jit->first].lastms){ - checker[jit->first].lastms = trackIt->second["lastms"].asInt(); - checker[jit->first].last_active = currTime; - } - if (trackIt->second["firsms"].asInt() > Storage["streams"][jit->first]["cut"].asInt()){ - Storage["streams"][jit->first].removeMember("cut"); - } //check H264 tracks for optimality if (jit->second.isMember("meta") && jit->second["meta"].isMember("tracks")){ for (JSON::ObjIter trIt = jit->second["meta"]["tracks"].ObjBegin(); trIt != jit->second["meta"]["tracks"].ObjEnd(); trIt++){ + if (trIt->second["lastms"].asInt() > checker[jit->first].lastms){ + checker[jit->first].lastms = trIt->second["lastms"].asInt(); + checker[jit->first].last_active = currTime; + } if (trIt->second["codec"] == "H264"){ if (trIt->second.isMember("init")){ if (trIt->second["init"].asString().size() < 4){ diff --git a/src/input/input_buffer.cpp b/src/input/input_buffer.cpp index 57a14639..ba96aaca 100644 --- a/src/input/input_buffer.cpp +++ b/src/input/input_buffer.cpp @@ -50,6 +50,8 @@ namespace Mist { } } myMeta.bufferWindow = lastms - firstms; + myMeta.vod = false; + myMeta.live = true; myMeta.writeTo(metaPage.mapped); } diff --git a/src/output/output.cpp b/src/output/output.cpp index 594eb475..bf93e9d1 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -57,7 +57,8 @@ namespace Mist { //read metadata from page to myMeta variable if (streamIndex.mapped){ DTSC::Packet tmpMeta(streamIndex.mapped, streamIndex.len, true); - if (tmpMeta){ + if (tmpMeta.getVersion()){ + /// \todo Make sure this doesn't go wrong when overwritten by MistInBuffer during parse myMeta.reinit(tmpMeta); } }