More debugging.
This commit is contained in:
parent
8d3daf4def
commit
1676159298
2 changed files with 18 additions and 12 deletions
|
@ -194,6 +194,7 @@ void Controller::SharedMemStats(void * config){
|
||||||
void Controller::statSession::update(unsigned long index, IPC::statExchange & data){
|
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)
|
//update the sync byte: 0 = requesting fill, 1 = needs checking, > 1 = state known (100=denied, 10=accepted)
|
||||||
if (!data.getSync()){
|
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 we have a maximum connection count per IP, enforce it
|
||||||
if (maxConnsPerIP){
|
if (maxConnsPerIP){
|
||||||
unsigned int currConns = 1;
|
unsigned int currConns = 1;
|
||||||
|
@ -653,12 +654,14 @@ void Controller::parseStatistics(char * data, size_t len, unsigned int id){
|
||||||
sessions[idx].finish(id);
|
sessions[idx].finish(id);
|
||||||
connToSession.erase(id);
|
connToSession.erase(id);
|
||||||
}else{
|
}else{
|
||||||
std::string strmName = tmpEx.streamName();
|
if (sessions[idx].getSessType() != SESS_OUTPUT){
|
||||||
if (strmName.size()){
|
std::string strmName = tmpEx.streamName();
|
||||||
if (!activeStreams.count(strmName)){
|
if (strmName.size()){
|
||||||
streamStarted(strmName);
|
if (!activeStreams.count(strmName)){
|
||||||
|
streamStarted(strmName);
|
||||||
|
}
|
||||||
|
activeStreams[strmName] = 0;
|
||||||
}
|
}
|
||||||
activeStreams[strmName] = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*LTS-START*/
|
/*LTS-START*/
|
||||||
|
|
|
@ -995,16 +995,16 @@ namespace Mist {
|
||||||
int nextPage = pageNumForKey(nxt.tid, nxtKeyNum[nxt.tid]+1);
|
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.
|
//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.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.
|
//we're waiting for new data. Simply retry.
|
||||||
buffer.insert(nxt);
|
buffer.insert(nxt);
|
||||||
}else{
|
}else{
|
||||||
//after ~10 seconds, give up and drop the track.
|
//after ~25 seconds, give up and drop the track.
|
||||||
//roxlu edited this line:
|
|
||||||
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);
|
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
|
//keep updating the metadata at 250ms intervals while waiting for more data
|
||||||
Util::wait(250);
|
Util::wait(250);
|
||||||
|
stats();
|
||||||
updateMeta();
|
updateMeta();
|
||||||
}else{
|
}else{
|
||||||
//if we're not live, we've simply reached the end of the page. Load the next key.
|
//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.
|
//Failure here will cause tracks to drop due to inconsistent internal state.
|
||||||
nxtKeyNum[nxt.tid] = getKeyForTime(nxt.tid, thisPacket.getTime());
|
nxtKeyNum[nxt.tid] = getKeyForTime(nxt.tid, thisPacket.getTime());
|
||||||
int counter = 0;
|
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++){
|
if (counter++){
|
||||||
//Only sleep 500ms if this is not the first updatemeta try
|
//Only sleep 250ms if this is not the first updatemeta try
|
||||||
Util::wait(500);
|
Util::wait(250);
|
||||||
}
|
}
|
||||||
updateMeta();
|
updateMeta();
|
||||||
nxtKeyNum[nxt.tid] = getKeyForTime(nxt.tid, thisPacket.getTime());
|
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{
|
}else{
|
||||||
//On non-video tracks, just update metadata and assume everything else is correct
|
//On non-video tracks, just update metadata and assume everything else is correct
|
||||||
updateMeta();
|
updateMeta();
|
||||||
|
@ -1142,7 +1145,7 @@ namespace Mist {
|
||||||
if (!isInitialized){
|
if (!isInitialized){
|
||||||
return;
|
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()){
|
if (statsPage.getData()){
|
||||||
unsigned long long int now = Util::epoch();
|
unsigned long long int now = Util::epoch();
|
||||||
if (now != lastStats){
|
if (now != lastStats){
|
||||||
|
|
Loading…
Add table
Reference in a new issue