Commit b70f08b7 by sneelavara

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
parent 4907cf87
...@@ -1226,18 +1226,18 @@ public final class Cea708Decoder extends CeaDecoder { ...@@ -1226,18 +1226,18 @@ public final class Cea708Decoder extends CeaDecoder {
// | | // | |
// 6-----7-----8 // 6-----7-----8
@AnchorType int verticalAnchorType; @AnchorType int verticalAnchorType;
if (anchorId % 3 == 0) { if (anchorId / 3 == 0) {
verticalAnchorType = Cue.ANCHOR_TYPE_START; verticalAnchorType = Cue.ANCHOR_TYPE_START;
} else if (anchorId % 3 == 1) { } else if (anchorId / 3 == 1) {
verticalAnchorType = Cue.ANCHOR_TYPE_MIDDLE; verticalAnchorType = Cue.ANCHOR_TYPE_MIDDLE;
} else { } else {
verticalAnchorType = Cue.ANCHOR_TYPE_END; verticalAnchorType = Cue.ANCHOR_TYPE_END;
} }
// TODO: Add support for right-to-left languages (i.e. where start is on the right). // TODO: Add support for right-to-left languages (i.e. where start is on the right).
@AnchorType int horizontalAnchorType; @AnchorType int horizontalAnchorType;
if (anchorId / 3 == 0) { if (anchorId % 3 == 0) {
horizontalAnchorType = Cue.ANCHOR_TYPE_START; horizontalAnchorType = Cue.ANCHOR_TYPE_START;
} else if (anchorId / 3 == 1) { } else if (anchorId % 3 == 1) {
horizontalAnchorType = Cue.ANCHOR_TYPE_MIDDLE; horizontalAnchorType = Cue.ANCHOR_TYPE_MIDDLE;
} else { } else {
horizontalAnchorType = Cue.ANCHOR_TYPE_END; horizontalAnchorType = Cue.ANCHOR_TYPE_END;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment