More debug level tweaks at production level.

This commit is contained in:
Thulinma 2016-05-25 12:20:37 +02:00
parent 3c5f612709
commit 3bbda96ca0
2 changed files with 15 additions and 12 deletions

View file

@ -257,11 +257,11 @@ namespace Mist {
if (myMeta.live && !isReadyForPlay()){
unsigned long long waitUntil = Util::epoch() + 15;
while (!isReadyForPlay()){
Util::sleep(1000);
if (Util::epoch() > waitUntil){
FAIL_MSG("Giving up waiting for playable tracks. Stream: %s, IP: %s", streamName.c_str(), getConnectedHost().c_str());
INFO_MSG("Giving up waiting for playable tracks. Stream: %s, IP: %s", streamName.c_str(), getConnectedHost().c_str());
break;
}
Util::wait(750);
stats();
updateMeta();
}
@ -962,6 +962,7 @@ namespace Mist {
}
void Output::prepareNext(){
static bool atLivePoint = false;
static int nonVideoCount = 0;
if (!sought){
if (myMeta.live){
@ -1081,15 +1082,18 @@ namespace Mist {
}
thisPacket.reInit(nProxy.curPage[nxt.tid].mapped + nxt.offset, 0, true);
if (thisPacket){
if (thisPacket.getTime() != nxt.time && nxt.time){
static bool warned = false;
if (!warned){
WARN_MSG("Loaded track %ld@%llu instead of %ld@%llu for %s - further warnings at HIGH level", thisPacket.getTrackId(), thisPacket.getTime(), nxt.tid, nxt.time, streamName.c_str());
warned = true;
if (thisPacket.getTime() != nxt.time && nxt.time && !atLivePoint){
static int warned = 0;
if (warned < 10){
WARN_MSG("Loaded track %ld@%llu instead of %u@%llu for %s", thisPacket.getTrackId(), thisPacket.getTime(), nxt.tid, nxt.time, streamName.c_str());
if (++warned == 10){
WARN_MSG("Further warnings about time mismatches printed on HIGH level.");
}
}else{
HIGH_MSG("Loaded track %ld@%llu instead of %ld@%llu for %s", thisPacket.getTrackId(), thisPacket.getTime(), nxt.tid, nxt.time, streamName.c_str());
HIGH_MSG("Loaded track %ld@%llu instead of %u@%llu for %s", thisPacket.getTrackId(), thisPacket.getTime(), nxt.tid, nxt.time, streamName.c_str());
}
}
atLivePoint = false;
bool isVideoTrack = (myMeta.tracks[nxt.tid].type == "video");
if ((isVideoTrack && thisPacket.getFlag("keyframe")) || (!isVideoTrack && (++nonVideoCount % 30 == 0))){
if (myMeta.live){
@ -1173,6 +1177,7 @@ namespace Mist {
nxt.time = nextTime;
}else{
++nxt.time;
atLivePoint = true;
}
}
buffer.insert(nxt);

View file

@ -90,14 +90,13 @@ namespace Mist {
result << "#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=" << (myMeta.tracks[*audioTracks.begin()].bps * 8) << "\r\n";
result << *audioTracks.begin() << "/index.m3u8\r\n";
}
DEBUG_MSG(DLVL_HIGH, "Sending this index: %s", result.str().c_str());
return result.str();
}
std::string OutHLS::pushLiveIndex(int tid, unsigned long bTime, unsigned long eTime){
updateMeta();
if (!myMeta.tracks[tid].fragments.size()) {
DEBUG_MSG(DLVL_FAIL, "liveIndex called with track %d, which has no fragments!", tid);
INFO_MSG("liveIndex called with track %d, which has no fragments!", tid);
return "";
}
std::stringstream result;
@ -140,7 +139,6 @@ namespace Mist {
if (!myMeta.live && eTime >= myMeta.tracks[tid].lastms) {
result << "#EXT-X-ENDLIST\r\n";
}
DEBUG_MSG(DLVL_HIGH, "Sending this index: %s", result.str().c_str());
return result.str();
}
@ -151,7 +149,7 @@ namespace Mist {
//parse single track
int longestFragment = 0;
if (!myMeta.tracks[tid].fragments.size()) {
DEBUG_MSG(DLVL_FAIL, "liveIndex called with track %d, which has no fragments!", tid);
INFO_MSG("liveIndex called with track %d, which has no fragments!", tid);
return "";
}
for (std::deque<DTSC::Fragment>::iterator it = myMeta.tracks[tid].fragments.begin(); (it + 1) != myMeta.tracks[tid].fragments.end(); it++) {