Fixed livepeer process disconnecting track 0 instead of actual track ID
This commit is contained in:
		
							parent
							
								
									6c66a4adb3
								
							
						
					
					
						commit
						b1740e9bd3
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -228,10 +228,11 @@ namespace Mist{
 | 
			
		|||
                if (S.lastPacket >= statSinkMs){statSinkMs = S.lastPacket;}
 | 
			
		||||
              }
 | 
			
		||||
              trackId = (S.ID << 16) + thisPacket.getTrackId();
 | 
			
		||||
              size_t idx = M.trackIDToIndex(trackId, getpid());
 | 
			
		||||
              if (idx == INVALID_TRACK_ID || !M.getCodec(idx).size()){
 | 
			
		||||
              thisIdx = M.trackIDToIndex(trackId, getpid());
 | 
			
		||||
              if (thisIdx == INVALID_TRACK_ID || !M.getCodec(thisIdx).size()){
 | 
			
		||||
                INFO_MSG("Initializing track %zi as %" PRIu64 " for playlist %zu", thisPacket.getTrackId(), trackId, S.ID);
 | 
			
		||||
                S.S.initializeMetadata(meta, thisPacket.getTrackId(), trackId);
 | 
			
		||||
                thisIdx = M.trackIDToIndex(trackId, getpid());
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
            if (S.byteOffset >= S.data.size() && !S.S.hasPacket()){
 | 
			
		||||
| 
						 | 
				
			
			@ -254,7 +255,8 @@ namespace Mist{
 | 
			
		|||
        //overwrite trackID
 | 
			
		||||
        Bit::htobl(data + 8, trackId);
 | 
			
		||||
        //overwrite packettime
 | 
			
		||||
        Bit::htobll(data + 12, thisPacket.getTime() + timeOffset);
 | 
			
		||||
        thisTime = thisPacket.getTime() + timeOffset;
 | 
			
		||||
        Bit::htobll(data + 12, thisTime);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    bool checkArguments(){return true;}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue