From b70f08b74048117373afe8efc917c9d66b24b658 Mon Sep 17 00:00:00 2001 From: sneelavara Date: Wed, 16 Dec 2020 16:22:12 -0800 Subject: [PATCH] CEA-708 Decoder fixes for issue #1807 Fixed the verticalAnchorType and horizontalAnchorType calculation The anchorID 0, 1 and 2 should correspond to verticalAnchorType=ANCHOR_TYPE_START, anchorID 3, 4, 5 is ANCHOR_TYPE_MIDDLE, anchorID 6, 7 and 8 is ANCHOR_TYPE_END The anchorID 0, 3 and 6 should correspond to horizzonatlAnchor=ANCHOR_TYPE_START, anchorID 1, 4, 7 is ANCHOR_TYPE_MIDDLE, anchorID 2, 5 and 8 is ANCHOR_TYPE_END --- .../google/android/exoplayer2/text/cea/Cea708Decoder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea708Decoder.java b/library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea708Decoder.java index 8bd46fabdc..56dd4ebef2 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea708Decoder.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea708Decoder.java @@ -1226,18 +1226,18 @@ public final class Cea708Decoder extends CeaDecoder { // | | // 6-----7-----8 @AnchorType int verticalAnchorType; - if (anchorId % 3 == 0) { + if (anchorId / 3 == 0) { verticalAnchorType = Cue.ANCHOR_TYPE_START; - } else if (anchorId % 3 == 1) { + } else if (anchorId / 3 == 1) { verticalAnchorType = Cue.ANCHOR_TYPE_MIDDLE; } else { verticalAnchorType = Cue.ANCHOR_TYPE_END; } // TODO: Add support for right-to-left languages (i.e. where start is on the right). @AnchorType int horizontalAnchorType; - if (anchorId / 3 == 0) { + if (anchorId % 3 == 0) { horizontalAnchorType = Cue.ANCHOR_TYPE_START; - } else if (anchorId / 3 == 1) { + } else if (anchorId % 3 == 1) { horizontalAnchorType = Cue.ANCHOR_TYPE_MIDDLE; } else { horizontalAnchorType = Cue.ANCHOR_TYPE_END;