mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +00:00
Tweak null-checking in TextRenderer#getNextEventTime()
`subtitle` is only guaranteed to be non-null if
`nextSubtitleEventIndex != C.INDEX_UNSET`. The null check added in
0efec5f6c1
was too early.
Issue: #8017
PiperOrigin-RevId: 334777742
This commit is contained in:
parent
b8c8ce0ee0
commit
13d8860221
2 changed files with 8 additions and 3 deletions
|
|
@ -13,6 +13,8 @@
|
|||
* Add support for `\h` SSA/ASS style override code (non-breaking space).
|
||||
* Fix WebVTT subtitles in MP4 containers in DASH streams
|
||||
([#7985](https://github.com/google/ExoPlayer/issues/7985)).
|
||||
* Fix NPE in `TextRenderer` when playing content with a single subtitle
|
||||
buffer ([#8017](https://github.com/google/ExoPlayer/issues/8017)).
|
||||
* UI:
|
||||
* Do not require subtitleButton in custom layouts of StyledPlayerView
|
||||
([#7962](https://github.com/google/ExoPlayer/issues/7962)).
|
||||
|
|
|
|||
|
|
@ -325,10 +325,13 @@ public final class TextRenderer extends BaseRenderer implements Callback {
|
|||
}
|
||||
|
||||
private long getNextEventTime() {
|
||||
if (nextSubtitleEventIndex == C.INDEX_UNSET) {
|
||||
return Long.MAX_VALUE;
|
||||
}
|
||||
checkNotNull(subtitle);
|
||||
return nextSubtitleEventIndex == C.INDEX_UNSET
|
||||
|| nextSubtitleEventIndex >= subtitle.getEventTimeCount()
|
||||
? Long.MAX_VALUE : subtitle.getEventTime(nextSubtitleEventIndex);
|
||||
return nextSubtitleEventIndex >= subtitle.getEventTimeCount()
|
||||
? Long.MAX_VALUE
|
||||
: subtitle.getEventTime(nextSubtitleEventIndex);
|
||||
}
|
||||
|
||||
private void updateOutput(List<Cue> cues) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue