More debugging.

This commit is contained in:
Thulinma 2016-05-19 12:51:51 +02:00
parent 8d3daf4def
commit 1676159298
2 changed files with 18 additions and 12 deletions

View file

@ -194,6 +194,7 @@ void Controller::SharedMemStats(void * config){
void Controller::statSession::update(unsigned long index, IPC::statExchange & data){
//update the sync byte: 0 = requesting fill, 1 = needs checking, > 1 = state known (100=denied, 10=accepted)
if (!data.getSync()){
WARN_MSG("Setting sync to %u for %s, %s, %lu", sync, data.streamName().c_str(), data.connector().c_str(), data.crc());
//if we have a maximum connection count per IP, enforce it
if (maxConnsPerIP){
unsigned int currConns = 1;
@ -653,12 +654,14 @@ void Controller::parseStatistics(char * data, size_t len, unsigned int id){
sessions[idx].finish(id);
connToSession.erase(id);
}else{
std::string strmName = tmpEx.streamName();
if (strmName.size()){
if (!activeStreams.count(strmName)){
streamStarted(strmName);
if (sessions[idx].getSessType() != SESS_OUTPUT){
std::string strmName = tmpEx.streamName();
if (strmName.size()){
if (!activeStreams.count(strmName)){
streamStarted(strmName);
}
activeStreams[strmName] = 0;
}
activeStreams[strmName] = 0;
}
}
/*LTS-START*/

View file

@ -995,16 +995,16 @@ namespace Mist {
int nextPage = pageNumForKey(nxt.tid, nxtKeyNum[nxt.tid]+1);
//are we live, and the next key hasn't shown up on another page? then we're waiting.
if (myMeta.live && currKeyOpen.count(nxt.tid) && (currKeyOpen[nxt.tid] == (unsigned int)nextPage || nextPage == -1)){
if (myMeta && ++emptyCount < 42){
if (myMeta && ++emptyCount < 100){
//we're waiting for new data. Simply retry.
buffer.insert(nxt);
}else{
//after ~10 seconds, give up and drop the track.
//roxlu edited this line:
//after ~25 seconds, give up and drop the track.
WARN_MSG("Empty packet on track %u (%s) @ key %lu (next=%d) - could not reload, dropping track.", nxt.tid, myMeta.tracks[nxt.tid].type.c_str(), nxtKeyNum[nxt.tid]+1, nextPage);
}
//keep updating the metadata at 250ms intervals while waiting for more data
Util::wait(250);
stats();
updateMeta();
}else{
//if we're not live, we've simply reached the end of the page. Load the next key.
@ -1042,14 +1042,17 @@ namespace Mist {
//Failure here will cause tracks to drop due to inconsistent internal state.
nxtKeyNum[nxt.tid] = getKeyForTime(nxt.tid, thisPacket.getTime());
int counter = 0;
while(counter < 10 && myMeta.tracks[nxt.tid].getKey(nxtKeyNum[nxt.tid]).getTime() != thisPacket.getTime()){
while(counter < 100 && myMeta.tracks[nxt.tid].getKey(nxtKeyNum[nxt.tid]).getTime() != thisPacket.getTime()){
if (counter++){
//Only sleep 500ms if this is not the first updatemeta try
Util::wait(500);
//Only sleep 250ms if this is not the first updatemeta try
Util::wait(250);
}
updateMeta();
nxtKeyNum[nxt.tid] = getKeyForTime(nxt.tid, thisPacket.getTime());
}
if (myMeta.tracks[nxt.tid].getKey(nxtKeyNum[nxt.tid]).getTime() != thisPacket.getTime()){
WARN_MSG("Keyframe value is not correct - state will now be inconsistent.");
}
}else{
//On non-video tracks, just update metadata and assume everything else is correct
updateMeta();
@ -1142,7 +1145,7 @@ namespace Mist {
if (!isInitialized){
return;
}
EXTREME_MSG("Writing stats: %s, %s, %lu", getConnectedHost().c_str(), streamName.c_str(), crc);
EXTREME_MSG("Writing stats: %s, %s, %lu", getConnectedHost().c_str(), streamName.c_str(), crc & 0xFFFFFFFFu);
if (statsPage.getData()){
unsigned long long int now = Util::epoch();
if (now != lastStats){