diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.java index 8544a294a8..4f32344638 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.java @@ -101,8 +101,9 @@ public class DefaultLoadErrorHandlingPolicy implements LoadErrorHandlingPolicy { /** * Retries for any exception that is not a subclass of {@link ParserException}, {@link * FileNotFoundException}, {@link CleartextNotPermittedException} or {@link - * UnexpectedLoaderException}. The retry delay is calculated as {@code Math.min((errorCount - 1) * - * 1000, 5000)}. + * UnexpectedLoaderException}, and for which {@link + * DataSourceException#isCausedByPositionOutOfRange} returns {@code false}. The retry delay is + * calculated as {@code Math.min((errorCount - 1) * 1000, 5000)}. */ @Override public long getRetryDelayMsFor(LoadErrorInfo loadErrorInfo) { @@ -111,6 +112,7 @@ public class DefaultLoadErrorHandlingPolicy implements LoadErrorHandlingPolicy { || exception instanceof FileNotFoundException || exception instanceof CleartextNotPermittedException || exception instanceof UnexpectedLoaderException + || DataSourceException.isCausedByPositionOutOfRange(exception) ? C.TIME_UNSET : min((loadErrorInfo.errorCount - 1) * 1000, 5000); }