protected boolean isChunkReady ( StreamingTrack streamingTrack , StreamingSample next ) { long ts = nextSampleStartTime . get ( streamingTrack ) ; long cfst = nextChunkCreateStartTime . get ( streamingTrack ) ; return ( ts >= cfst + 2 * streamingTrack . getTimescale ( ) ) ; // chunk interleave of 2 seconds }
Tests if the currently received samples for a given track are already a chunk as we want to have it . The next sample will not be part of the chunk will be added to the fragment buffer later .