示例#1
0
 @Override
 public void onLoadCanceled(Loadable loadable) {
   Chunk currentLoadable = currentLoadableHolder.chunk;
   notifyLoadCanceled(currentLoadable.bytesLoaded());
   clearCurrentLoadable();
   if (state == STATE_ENABLED) {
     restartFrom(pendingResetPositionUs);
   } else {
     sampleQueue.clear();
     mediaChunks.clear();
     clearCurrentLoadable();
     loadControl.trimAllocator();
   }
 }
示例#2
0
 @Override
 public void disable(int track) {
   Assertions.checkState(state == STATE_ENABLED);
   Assertions.checkState(--enabledTrackCount == 0);
   state = STATE_PREPARED;
   try {
     chunkSource.disable(mediaChunks);
   } finally {
     loadControl.unregister(this);
     if (loader.isLoading()) {
       loader.cancelLoading();
     } else {
       sampleQueue.clear();
       mediaChunks.clear();
       clearCurrentLoadable();
       loadControl.trimAllocator();
     }
   }
 }