More debug level tweaks at production level.
This commit is contained in:
		
							parent
							
								
									3c5f612709
								
							
						
					
					
						commit
						3bbda96ca0
					
				
					 2 changed files with 15 additions and 12 deletions
				
			
		| 
						 | 
					@ -257,11 +257,11 @@ namespace Mist {
 | 
				
			||||||
    if (myMeta.live && !isReadyForPlay()){
 | 
					    if (myMeta.live && !isReadyForPlay()){
 | 
				
			||||||
      unsigned long long waitUntil = Util::epoch() + 15;
 | 
					      unsigned long long waitUntil = Util::epoch() + 15;
 | 
				
			||||||
      while (!isReadyForPlay()){
 | 
					      while (!isReadyForPlay()){
 | 
				
			||||||
        Util::sleep(1000);
 | 
					 | 
				
			||||||
        if (Util::epoch() > waitUntil){
 | 
					        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;
 | 
					          break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        Util::wait(750);
 | 
				
			||||||
        stats();
 | 
					        stats();
 | 
				
			||||||
        updateMeta();
 | 
					        updateMeta();
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
| 
						 | 
					@ -962,6 +962,7 @@ namespace Mist {
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  void Output::prepareNext(){
 | 
					  void Output::prepareNext(){
 | 
				
			||||||
 | 
					    static bool atLivePoint = false;
 | 
				
			||||||
    static int nonVideoCount = 0;
 | 
					    static int nonVideoCount = 0;
 | 
				
			||||||
    if (!sought){
 | 
					    if (!sought){
 | 
				
			||||||
      if (myMeta.live){
 | 
					      if (myMeta.live){
 | 
				
			||||||
| 
						 | 
					@ -1081,15 +1082,18 @@ namespace Mist {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    thisPacket.reInit(nProxy.curPage[nxt.tid].mapped + nxt.offset, 0, true);
 | 
					    thisPacket.reInit(nProxy.curPage[nxt.tid].mapped + nxt.offset, 0, true);
 | 
				
			||||||
    if (thisPacket){
 | 
					    if (thisPacket){
 | 
				
			||||||
      if (thisPacket.getTime() != nxt.time && nxt.time){
 | 
					      if (thisPacket.getTime() != nxt.time && nxt.time && !atLivePoint){
 | 
				
			||||||
        static bool warned = false;
 | 
					        static int warned = 0;
 | 
				
			||||||
        if (!warned){
 | 
					        if (warned < 10){
 | 
				
			||||||
          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());
 | 
					          WARN_MSG("Loaded track %ld@%llu instead of %u@%llu for %s", thisPacket.getTrackId(), thisPacket.getTime(), nxt.tid, nxt.time, streamName.c_str());
 | 
				
			||||||
          warned = true;
 | 
					          if (++warned == 10){
 | 
				
			||||||
 | 
					            WARN_MSG("Further warnings about time mismatches printed on HIGH level.");
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
        }else{
 | 
					        }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");
 | 
					      bool isVideoTrack = (myMeta.tracks[nxt.tid].type == "video");
 | 
				
			||||||
      if ((isVideoTrack && thisPacket.getFlag("keyframe")) || (!isVideoTrack && (++nonVideoCount % 30 == 0))){
 | 
					      if ((isVideoTrack && thisPacket.getFlag("keyframe")) || (!isVideoTrack && (++nonVideoCount % 30 == 0))){
 | 
				
			||||||
        if (myMeta.live){
 | 
					        if (myMeta.live){
 | 
				
			||||||
| 
						 | 
					@ -1173,6 +1177,7 @@ namespace Mist {
 | 
				
			||||||
          nxt.time = nextTime;
 | 
					          nxt.time = nextTime;
 | 
				
			||||||
        }else{
 | 
					        }else{
 | 
				
			||||||
          ++nxt.time;
 | 
					          ++nxt.time;
 | 
				
			||||||
 | 
					          atLivePoint = true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      buffer.insert(nxt);
 | 
					      buffer.insert(nxt);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -90,14 +90,13 @@ namespace Mist {
 | 
				
			||||||
      result << "#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=" << (myMeta.tracks[*audioTracks.begin()].bps * 8) << "\r\n";
 | 
					      result << "#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=" << (myMeta.tracks[*audioTracks.begin()].bps * 8) << "\r\n";
 | 
				
			||||||
      result << *audioTracks.begin() << "/index.m3u8\r\n";
 | 
					      result << *audioTracks.begin() << "/index.m3u8\r\n";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    DEBUG_MSG(DLVL_HIGH, "Sending this index: %s", result.str().c_str());
 | 
					 | 
				
			||||||
    return result.str();
 | 
					    return result.str();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  std::string OutHLS::pushLiveIndex(int tid, unsigned long bTime, unsigned long eTime){
 | 
					  std::string OutHLS::pushLiveIndex(int tid, unsigned long bTime, unsigned long eTime){
 | 
				
			||||||
    updateMeta();
 | 
					    updateMeta();
 | 
				
			||||||
    if (!myMeta.tracks[tid].fragments.size()) {
 | 
					    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 "";
 | 
					      return "";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    std::stringstream result;
 | 
					    std::stringstream result;
 | 
				
			||||||
| 
						 | 
					@ -140,7 +139,6 @@ namespace Mist {
 | 
				
			||||||
    if (!myMeta.live && eTime >= myMeta.tracks[tid].lastms) {
 | 
					    if (!myMeta.live && eTime >= myMeta.tracks[tid].lastms) {
 | 
				
			||||||
      result << "#EXT-X-ENDLIST\r\n";
 | 
					      result << "#EXT-X-ENDLIST\r\n";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    DEBUG_MSG(DLVL_HIGH, "Sending this index: %s", result.str().c_str());
 | 
					 | 
				
			||||||
    return result.str();
 | 
					    return result.str();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -151,7 +149,7 @@ namespace Mist {
 | 
				
			||||||
    //parse single track
 | 
					    //parse single track
 | 
				
			||||||
    int longestFragment = 0;
 | 
					    int longestFragment = 0;
 | 
				
			||||||
    if (!myMeta.tracks[tid].fragments.size()) {
 | 
					    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 "";
 | 
					      return "";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    for (std::deque<DTSC::Fragment>::iterator it = myMeta.tracks[tid].fragments.begin(); (it + 1) != myMeta.tracks[tid].fragments.end(); it++) {
 | 
					    for (std::deque<DTSC::Fragment>::iterator it = myMeta.tracks[tid].fragments.begin(); (it + 1) != myMeta.tracks[tid].fragments.end(); it++) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue