Fixed an issue with Cea608Decoder in which tab commands were not being used correctly.

Tab commands were being used cumulatively (i.e. moving the cursor farther and farther over) resulting in the text eventually trying to write beyond the bounds of the screen and throwing an exception.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146783284
This commit is contained in:
cdrolle 2017-02-07 07:15:39 -08:00 committed by Oliver Woodman
parent 7c8a3d006d
commit de46ed7fb9

View file

@ -364,7 +364,7 @@ public final class Cea608Decoder extends CeaDecoder {
} else if (isPreambleAddressCode(cc1, cc2)) {
handlePreambleAddressCode(cc1, cc2);
} else if (isTabCtrlCode(cc1, cc2)) {
currentCueBuilder.tab(cc2 - 0x20);
currentCueBuilder.setTab(cc2 - 0x20);
} else if (isMiscCode(cc1, cc2)) {
handleMiscCode(cc2);
}
@ -646,8 +646,8 @@ public final class Cea608Decoder extends CeaDecoder {
this.indent = indent;
}
public void tab(int tabs) {
tabOffset += tabs;
public void setTab(int tabs) {
tabOffset = tabs;
}
public void setPreambleStyle(CharacterStyle style) {