diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java index 38b9648162..65dea43d08 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java @@ -1315,7 +1315,7 @@ import java.io.IOException; repeatMode); } - if (newLoadingPeriodIndex >= timeline.getPeriodCount()) { + if (newLoadingPeriodIndex == C.INDEX_UNSET) { // The next period is not available yet. mediaSource.maybeThrowSourceInfoRefreshError(); return;