Removed TS-level discontinuities from HLS
This commit is contained in:
		
							parent
							
								
									f69fe8a4fb
								
							
						
					
					
						commit
						653f5cf085
					
				
					 2 changed files with 18 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -277,7 +277,25 @@ namespace Mist {
 | 
			
		|||
      stop();
 | 
			
		||||
      wantRequest = true;
 | 
			
		||||
      parseData = false;
 | 
			
		||||
 | 
			
		||||
      //Ensure alignment of contCounters for selected tracks, to prevent discontinuities.
 | 
			
		||||
      for (std::set<unsigned long>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); ++it){
 | 
			
		||||
        DTSC::Track & Trk = myMeta.tracks[*it];
 | 
			
		||||
        uint32_t pkgPid = 255 + *it;
 | 
			
		||||
        int & contPkg = contCounters[pkgPid];
 | 
			
		||||
        if (contPkg % 16 != 0){
 | 
			
		||||
          packData.clear();
 | 
			
		||||
          packData.setPID(pkgPid);
 | 
			
		||||
          packData.addStuffing();
 | 
			
		||||
          while (contPkg % 16 != 0){
 | 
			
		||||
            packData.setContinuityCounter(++contPkg);
 | 
			
		||||
            sendTS(packData.checkAndGetBuffer());
 | 
			
		||||
          }
 | 
			
		||||
          packData.clear();
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      //Signal end of data
 | 
			
		||||
      H.Chunkify("", 0, myConn);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,7 +34,6 @@ namespace Mist {
 | 
			
		|||
        packData.setContinuityCounter(++contPkg);
 | 
			
		||||
        if (firstPack){
 | 
			
		||||
          packData.setUnitStart(1);
 | 
			
		||||
          packData.setDiscontinuity(true);
 | 
			
		||||
          if (video){
 | 
			
		||||
            if (keyframe){
 | 
			
		||||
              packData.setRandomAccess(true);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue