question: private boolean discardUpstreamMediaChunks ( int queueLength ) { if ( mediaChunks . size ( ) <= queueLength ) { return false ; } long startTimeUs = 0 ; long endTimeUs = mediaChunks . getLast ( ) . endTimeUs ; BaseMediaChunk removed = null ; while ( mediaChunks . size ( ) > queueLength ) { removed = mediaChunks . removeLast ( ) ; startTimeUs = removed . startTimeUs ; loadingFinished = false ; } sampleQueue . discardUpstreamSamples ( removed . getFirstSampleIndex ( ) ) ; notifyUpstreamDiscarded ( startTimeUs , endTimeUs ) ; return true ; }
target:  Discard upstream media chunks until the queue length is equal to the length specified.