From 7d524d6d6f5642bd4382ba1c40eda99c032dd339 Mon Sep 17 00:00:00 2001 From: andrewlewis Date: Mon, 20 Sep 2021 16:15:25 +0100 Subject: [PATCH] Fix incorrect @IntRange PiperOrigin-RevId: 397753634 --- .../android/exoplayer2/source/ads/AdPlaybackState.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/common/src/main/java/com/google/android/exoplayer2/source/ads/AdPlaybackState.java b/library/common/src/main/java/com/google/android/exoplayer2/source/ads/AdPlaybackState.java index 319b5cc12d..3c1427a2ec 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/source/ads/AdPlaybackState.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/source/ads/AdPlaybackState.java @@ -118,9 +118,10 @@ public final class AdPlaybackState implements Bundleable { /** * Returns the index of the next ad in the ad group that should be played after playing {@code - * lastPlayedAdIndex}, or {@link #count} if no later ads should be played. + * lastPlayedAdIndex}, or {@link #count} if no later ads should be played. If no ads have been + * played, pass -1 to get the index of the first ad to play. */ - public int getNextAdIndexToPlay(@IntRange(from = 0) int lastPlayedAdIndex) { + public int getNextAdIndexToPlay(@IntRange(from = -1) int lastPlayedAdIndex) { int nextAdIndexToPlay = lastPlayedAdIndex + 1; while (nextAdIndexToPlay < states.length) { if (isServerSideInserted