Java 类com.google.android.exoplayer2.source.chunk.ChunkedTrackBlacklistUtil 实例源码

项目:Exoplayer2Radio    文件:HlsPlaylistTracker.java   
@Override
public int onLoadError(ParsingLoadable<HlsPlaylist> loadable, long elapsedRealtimeMs,
    long loadDurationMs, IOException error) {
  boolean isFatal = error instanceof ParserException;
  eventDispatcher.loadError(loadable.dataSpec, C.DATA_TYPE_MANIFEST, elapsedRealtimeMs,
      loadDurationMs, loadable.bytesLoaded(), error, isFatal);
  if (isFatal) {
    return Loader.DONT_RETRY_FATAL;
  }
  boolean shouldRetry = true;
  if (ChunkedTrackBlacklistUtil.shouldBlacklist(error)) {
    blacklistUntilMs =
        SystemClock.elapsedRealtime() + ChunkedTrackBlacklistUtil.DEFAULT_TRACK_BLACKLIST_MS;
    notifyPlaylistBlacklisting(playlistUrl,
        ChunkedTrackBlacklistUtil.DEFAULT_TRACK_BLACKLIST_MS);
    shouldRetry = primaryHlsUrl == playlistUrl && !maybeSelectNewPrimaryUrl();
  }
  return shouldRetry ? Loader.RETRY : Loader.DONT_RETRY;
}
项目:K-Sonic    文件:HlsPlaylistTracker.java   
@Override
public int onLoadError(ParsingLoadable<HlsPlaylist> loadable, long elapsedRealtimeMs,
    long loadDurationMs, IOException error) {
  boolean isFatal = error instanceof ParserException;
  eventDispatcher.loadError(loadable.dataSpec, C.DATA_TYPE_MANIFEST, elapsedRealtimeMs,
      loadDurationMs, loadable.bytesLoaded(), error, isFatal);
  if (isFatal) {
    return Loader.DONT_RETRY_FATAL;
  }
  boolean shouldRetry = true;
  if (ChunkedTrackBlacklistUtil.shouldBlacklist(error)) {
    blacklistUntilMs =
        SystemClock.elapsedRealtime() + ChunkedTrackBlacklistUtil.DEFAULT_TRACK_BLACKLIST_MS;
    notifyPlaylistBlacklisting(playlistUrl,
        ChunkedTrackBlacklistUtil.DEFAULT_TRACK_BLACKLIST_MS);
    shouldRetry = primaryHlsUrl == playlistUrl && !maybeSelectNewPrimaryUrl();
  }
  return shouldRetry ? Loader.RETRY : Loader.DONT_RETRY;
}
项目:K-Sonic    文件:DefaultDashChunkSource.java   
@Override
public boolean onChunkLoadError(Chunk chunk, boolean cancelable, Exception e) {
  if (!cancelable) {
    return false;
  }
  // Workaround for missing segment at the end of the period
  if (!manifest.dynamic && chunk instanceof MediaChunk
      && e instanceof InvalidResponseCodeException
      && ((InvalidResponseCodeException) e).responseCode == 404) {
    RepresentationHolder representationHolder =
        representationHolders[trackSelection.indexOf(chunk.trackFormat)];
    int segmentCount = representationHolder.getSegmentCount();
    if (segmentCount != DashSegmentIndex.INDEX_UNBOUNDED && segmentCount != 0) {
      int lastAvailableSegmentNum = representationHolder.getFirstSegmentNum() + segmentCount - 1;
      if (((MediaChunk) chunk).getNextChunkIndex() > lastAvailableSegmentNum) {
        missingLastSegment = true;
        return true;
      }
    }
  }
  // Blacklist if appropriate.
  return ChunkedTrackBlacklistUtil.maybeBlacklistTrack(trackSelection,
      trackSelection.indexOf(chunk.trackFormat), e);
}
项目:videoPickPlayer    文件:DefaultDashChunkSource.java   
@Override
public boolean onChunkLoadError(Chunk chunk, boolean cancelable, Exception e) {
  if (!cancelable) {
    return false;
  }
  // Workaround for missing segment at the end of the period
  if (!manifest.dynamic && chunk instanceof MediaChunk
      && e instanceof InvalidResponseCodeException
      && ((InvalidResponseCodeException) e).responseCode == 404) {
    RepresentationHolder representationHolder =
        representationHolders[trackSelection.indexOf(chunk.trackFormat)];
    int lastAvailableSegmentNum = representationHolder.getLastSegmentNum();
    if (((MediaChunk) chunk).chunkIndex >= lastAvailableSegmentNum) {
      missingLastSegment = true;
      return true;
    }
  }
  // Blacklist if appropriate.
  return ChunkedTrackBlacklistUtil.maybeBlacklistTrack(trackSelection,
      trackSelection.indexOf(chunk.trackFormat), e);
}
项目:transistor    文件:DefaultDashChunkSource.java   
@Override
public boolean onChunkLoadError(Chunk chunk, boolean cancelable, Exception e) {
  if (!cancelable) {
    return false;
  }
  // Workaround for missing segment at the end of the period
  if (!manifest.dynamic && chunk instanceof MediaChunk
      && e instanceof InvalidResponseCodeException
      && ((InvalidResponseCodeException) e).responseCode == 404) {
    RepresentationHolder representationHolder =
        representationHolders[trackSelection.indexOf(chunk.trackFormat)];
    int segmentCount = representationHolder.getSegmentCount();
    if (segmentCount != DashSegmentIndex.INDEX_UNBOUNDED && segmentCount != 0) {
      int lastAvailableSegmentNum = representationHolder.getFirstSegmentNum() + segmentCount - 1;
      if (((MediaChunk) chunk).getNextChunkIndex() > lastAvailableSegmentNum) {
        missingLastSegment = true;
        return true;
      }
    }
  }
  // Blacklist if appropriate.
  return ChunkedTrackBlacklistUtil.maybeBlacklistTrack(trackSelection,
      trackSelection.indexOf(chunk.trackFormat), e);
}
项目:transistor    文件:HlsPlaylistTracker.java   
@Override
public int onLoadError(ParsingLoadable<HlsPlaylist> loadable, long elapsedRealtimeMs,
    long loadDurationMs, IOException error) {
  boolean isFatal = error instanceof ParserException;
  eventDispatcher.loadError(loadable.dataSpec, C.DATA_TYPE_MANIFEST, elapsedRealtimeMs,
      loadDurationMs, loadable.bytesLoaded(), error, isFatal);
  if (isFatal) {
    return Loader.DONT_RETRY_FATAL;
  }
  boolean shouldRetry = true;
  if (ChunkedTrackBlacklistUtil.shouldBlacklist(error)) {
    shouldRetry = blacklistPlaylist();
  }
  return shouldRetry ? Loader.RETRY : Loader.DONT_RETRY;
}
项目:transistor    文件:HlsPlaylistTracker.java   
/**
 * Blacklists the playlist.
 *
 * @return Whether the playlist is the primary, despite being blacklisted.
 */
private boolean blacklistPlaylist() {
  blacklistUntilMs = SystemClock.elapsedRealtime()
      + ChunkedTrackBlacklistUtil.DEFAULT_TRACK_BLACKLIST_MS;
  notifyPlaylistBlacklisting(playlistUrl, ChunkedTrackBlacklistUtil.DEFAULT_TRACK_BLACKLIST_MS);
  return primaryHlsUrl == playlistUrl && !maybeSelectNewPrimaryUrl();
}
项目:K-Sonic    文件:DefaultSsChunkSource.java   
@Override
public boolean onChunkLoadError(Chunk chunk, boolean cancelable, Exception e) {
  return cancelable && ChunkedTrackBlacklistUtil.maybeBlacklistTrack(trackSelection,
      trackSelection.indexOf(chunk.trackFormat), e);
}
项目:videoPickPlayer    文件:DefaultSsChunkSource.java   
@Override
public boolean onChunkLoadError(Chunk chunk, boolean cancelable, Exception e) {
  return cancelable && ChunkedTrackBlacklistUtil.maybeBlacklistTrack(trackSelection,
      trackSelection.indexOf(chunk.trackFormat), e);
}
项目:transistor    文件:DefaultSsChunkSource.java   
@Override
public boolean onChunkLoadError(Chunk chunk, boolean cancelable, Exception e) {
  return cancelable && ChunkedTrackBlacklistUtil.maybeBlacklistTrack(trackSelection,
      trackSelection.indexOf(chunk.trackFormat), e);
}
项目:Exoplayer2Radio    文件:HlsChunkSource.java   
/**
 * Called when the {@link HlsSampleStreamWrapper} encounters an error loading a chunk obtained
 * from this source.
 *
 * @param chunk The chunk whose load encountered the error.
 * @param cancelable Whether the load can be canceled.
 * @param error The error.
 * @return Whether the load should be canceled.
 */
public boolean onChunkLoadError(Chunk chunk, boolean cancelable, IOException error) {
  return cancelable && ChunkedTrackBlacklistUtil.maybeBlacklistTrack(trackSelection,
      trackSelection.indexOf(trackGroup.indexOf(chunk.trackFormat)), error);
}
项目:K-Sonic    文件:HlsChunkSource.java   
/**
 * Called when the {@link HlsSampleStreamWrapper} encounters an error loading a chunk obtained
 * from this source.
 *
 * @param chunk The chunk whose load encountered the error.
 * @param cancelable Whether the load can be canceled.
 * @param error The error.
 * @return Whether the load should be canceled.
 */
public boolean onChunkLoadError(Chunk chunk, boolean cancelable, IOException error) {
  return cancelable && ChunkedTrackBlacklistUtil.maybeBlacklistTrack(trackSelection,
      trackSelection.indexOf(trackGroup.indexOf(chunk.trackFormat)), error);
}
项目:videoPickPlayer    文件:HlsChunkSource.java   
/**
 * Called when the {@link HlsSampleStreamWrapper} encounters an error loading a chunk obtained
 * from this source.
 *
 * @param chunk The chunk whose load encountered the error.
 * @param cancelable Whether the load can be canceled.
 * @param e The error.
 * @return Whether the load should be canceled.
 */
public boolean onChunkLoadError(Chunk chunk, boolean cancelable, IOException e) {
  return cancelable && ChunkedTrackBlacklistUtil.maybeBlacklistTrack(trackSelection,
      trackSelection.indexOf(trackGroup.indexOf(chunk.trackFormat)), e);
}
项目:transistor    文件:HlsChunkSource.java   
/**
 * Called when the {@link HlsSampleStreamWrapper} encounters an error loading a chunk obtained
 * from this source.
 *
 * @param chunk The chunk whose load encountered the error.
 * @param cancelable Whether the load can be canceled.
 * @param error The error.
 * @return Whether the load should be canceled.
 */
public boolean onChunkLoadError(Chunk chunk, boolean cancelable, IOException error) {
  return cancelable && ChunkedTrackBlacklistUtil.maybeBlacklistTrack(trackSelection,
      trackSelection.indexOf(trackGroup.indexOf(chunk.trackFormat)), error);
}