private boolean discardUpstreamMediaChunks(int queueLength){
  if (mediaChunks.size() <= queueLength) {
    return false;
  }
  long totalBytes=0;
  long startTimeUs=0;
  long endTimeUs=mediaChunks.getLast().endTimeUs;
  while (mediaChunks.size() > queueLength) {
    MediaChunk removed=mediaChunks.removeLast();
    totalBytes+=removed.bytesLoaded();
    startTimeUs=removed.startTimeUs;
    removed.release();
  }
  notifyUpstreamDiscarded(startTimeUs,endTimeUs,totalBytes);
  return true;
}

private boolean discardUpstreamMediaChunks ( int queueLength ) { if ( mediaChunks . size ( ) <= queueLength ) { return false ; } long totalBytes = 0 ; long startTimeUs = 0 ; long endTimeUs = mediaChunks . getLast ( ) . endTimeUs ; while ( mediaChunks . size ( ) > queueLength ) { MediaChunk removed = mediaChunks . removeLast ( ) ; totalBytes += removed . bytesLoaded ( ) ; startTimeUs = removed . startTimeUs ; removed . release ( ) ; } notifyUpstreamDiscarded ( startTimeUs , endTimeUs , totalBytes ) ; return true ; }
discard upstream media chunks until the queue length is equal to the length specified .
