diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 614e8ba794..d7bd90055e 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -8,6 +8,7 @@ * Add options for controlling audio track selections to `DefaultTrackSelector` ([#3314](https://github.com/google/ExoPlayer/issues/3314)). * Do not retry failed loads whose error is `FileNotFoundException`. +* Prevent Cea608Decoder from generating Subtitles with null Cues list ### 2.9.2 ### diff --git a/library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea608Decoder.java b/library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea608Decoder.java index 8742a6344e..613393ed06 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea608Decoder.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea608Decoder.java @@ -33,6 +33,7 @@ import com.google.android.exoplayer2.text.SubtitleInputBuffer; import com.google.android.exoplayer2.util.MimeTypes; import com.google.android.exoplayer2.util.ParsableByteArray; import java.util.ArrayList; +import java.util.Collections; import java.util.List; /** @@ -509,7 +510,7 @@ public final class Cea608Decoder extends CeaDecoder { switch (cc2) { case CTRL_ERASE_DISPLAYED_MEMORY: - cues = null; + cues = Collections.emptyList(); if (captionMode == CC_MODE_ROLL_UP || captionMode == CC_MODE_PAINT_ON) { resetCueBuilders(); } @@ -564,7 +565,7 @@ public final class Cea608Decoder extends CeaDecoder { if (oldCaptionMode == CC_MODE_PAINT_ON || captionMode == CC_MODE_ROLL_UP || captionMode == CC_MODE_UNKNOWN) { // When switching from paint-on or to roll-up or unknown, we also need to clear the caption. - cues = null; + cues = Collections.emptyList(); } }