From de46ed7fb90f9ec421c77e5888bb8ae4572bff83 Mon Sep 17 00:00:00 2001 From: cdrolle Date: Tue, 7 Feb 2017 07:15:39 -0800 Subject: [PATCH] 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 --- .../google/android/exoplayer2/text/cea/Cea608Decoder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/src/main/java/com/google/android/exoplayer2/text/cea/Cea608Decoder.java b/library/src/main/java/com/google/android/exoplayer2/text/cea/Cea608Decoder.java index 7324c94288..261f9d0e3e 100644 --- a/library/src/main/java/com/google/android/exoplayer2/text/cea/Cea608Decoder.java +++ b/library/src/main/java/com/google/android/exoplayer2/text/cea/Cea608Decoder.java @@ -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) {