Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public final class Cea608Decoder extends CeaDecoder {
private CueBuilder currentCueBuilder;
private List<Cue> cues;
private List<Cue> lastCues;
private long inputTimestampUs;

private int captionMode;
private int captionRowCount;
Expand Down Expand Up @@ -252,6 +253,7 @@ protected Subtitle createSubtitle() {

@Override
protected void decode(SubtitleInputBuffer inputBuffer) {
inputTimestampUs = inputBuffer.timeUs;
ccData.reset(inputBuffer.data.array(), inputBuffer.data.limit());
boolean captionDataProcessed = false;
boolean isRepeatableControl = false;
Expand Down Expand Up @@ -329,6 +331,7 @@ protected void decode(SubtitleInputBuffer inputBuffer) {
}
if (captionMode == CC_MODE_ROLL_UP || captionMode == CC_MODE_PAINT_ON) {
cues = getDisplayCues();
onNewSubtitleDataAvailable(inputTimestampUs); // update screen
}
}
}
Expand Down Expand Up @@ -454,12 +457,14 @@ private void handleMiscCode(byte cc2) {
if (captionMode == CC_MODE_ROLL_UP || captionMode == CC_MODE_PAINT_ON) {
resetCueBuilders();
}
onNewSubtitleDataAvailable(inputTimestampUs); // update screen
break;
case CTRL_ERASE_NON_DISPLAYED_MEMORY:
resetCueBuilders();
break;
case CTRL_END_OF_CAPTION:
cues = getDisplayCues();
onNewSubtitleDataAvailable(inputTimestampUs); // update screen
resetCueBuilders();
break;
case CTRL_CARRIAGE_RETURN:
Expand Down Expand Up @@ -506,6 +511,7 @@ private void setCaptionMode(int captionMode) {
|| captionMode == CC_MODE_UNKNOWN) {
// When switching from paint-on or to roll-up or unknown, we also need to clear the caption.
cues = null;
onNewSubtitleDataAvailable(inputTimestampUs); // update screen
}
}

Expand Down
Loading