mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Fix window index comparison.
To check the validity of a window index it needs to be compared with a greater or equal sign to the window count. Issue:#4822 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=213234403
This commit is contained in:
parent
caa46d49e5
commit
d1df41a39e
@ -133,6 +133,8 @@
|
||||
([#4774](https://github.com/google/ExoPlayer/issues/4774)).
|
||||
* Fix issue with audio discontinuities at period transitions, e.g. when
|
||||
looping ([#3829](https://github.com/google/ExoPlayer/issues/3829)).
|
||||
* Fix issue where `player.getCurrentTag()` throws an `IndexOutOfBoundsException`
|
||||
([#4822](https://github.com/google/ExoPlayer/issues/4822)).
|
||||
* IMA extension:
|
||||
* Refine the previous fix for empty ad groups to avoid discarding ad breaks
|
||||
unnecessarily ([#4030](https://github.com/google/ExoPlayer/issues/4030)),
|
||||
|
@ -495,7 +495,7 @@ public final class CastPlayer implements Player {
|
||||
@Override
|
||||
public @Nullable Object getCurrentTag() {
|
||||
int windowIndex = getCurrentWindowIndex();
|
||||
return windowIndex > currentTimeline.getWindowCount()
|
||||
return windowIndex >= currentTimeline.getWindowCount()
|
||||
? null
|
||||
: currentTimeline.getWindow(windowIndex, window, /* setTag= */ true).tag;
|
||||
}
|
||||
|
@ -380,7 +380,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||
@Override
|
||||
public @Nullable Object getCurrentTag() {
|
||||
int windowIndex = getCurrentWindowIndex();
|
||||
return windowIndex > playbackInfo.timeline.getWindowCount()
|
||||
return windowIndex >= playbackInfo.timeline.getWindowCount()
|
||||
? null
|
||||
: playbackInfo.timeline.getWindow(windowIndex, window, /* setTag= */ true).tag;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user