Fixed live support
This commit is contained in:
parent
d459a99317
commit
6f5f3b37c2
3 changed files with 8 additions and 10 deletions
|
@ -205,18 +205,13 @@ namespace Controller {
|
|||
// for live streams, keep track of activity
|
||||
if (jit->second["meta"].isMember("live")){
|
||||
static std::map<std::string, liveCheck> 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){
|
||||
|
|
|
@ -50,6 +50,8 @@ namespace Mist {
|
|||
}
|
||||
}
|
||||
myMeta.bufferWindow = lastms - firstms;
|
||||
myMeta.vod = false;
|
||||
myMeta.live = true;
|
||||
myMeta.writeTo(metaPage.mapped);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue