@@ -778,8 +778,11 @@ private void handleDefineWindow(int window) {
778
778
// first byte
779
779
captionChannelPacketData .skipBits (2 ); // null padding
780
780
boolean visible = captionChannelPacketData .readBit ();
781
- boolean rowLock = captionChannelPacketData .readBit ();
782
- boolean columnLock = captionChannelPacketData .readBit ();
781
+
782
+ // ANSI/CTA-708-E S-2023 spec (Section 8.4.7) indicates that rowLock and columnLock values in
783
+ // the media should be ignored and assumed to be true.
784
+ captionChannelPacketData .skipBits (2 );
785
+
783
786
int priority = captionChannelPacketData .readBits (3 );
784
787
// second byte
785
788
boolean relativePositioning = captionChannelPacketData .readBit ();
@@ -791,22 +794,20 @@ private void handleDefineWindow(int window) {
791
794
int rowCount = captionChannelPacketData .readBits (4 );
792
795
// fifth byte
793
796
captionChannelPacketData .skipBits (2 ); // null padding
794
- int columnCount = captionChannelPacketData .readBits (6 );
797
+ // TODO: Add support for column count.
798
+ captionChannelPacketData .skipBits (6 ); // column count
795
799
// sixth byte
796
800
captionChannelPacketData .skipBits (2 ); // null padding
797
801
int windowStyle = captionChannelPacketData .readBits (3 );
798
802
int penStyle = captionChannelPacketData .readBits (3 );
799
803
800
804
cueInfoBuilder .defineWindow (
801
805
visible ,
802
- rowLock ,
803
- columnLock ,
804
806
priority ,
805
807
relativePositioning ,
806
808
verticalAnchor ,
807
809
horizontalAnchor ,
808
810
rowCount ,
809
- columnCount ,
810
811
anchorId ,
811
812
windowStyle ,
812
813
penStyle );
@@ -967,7 +968,6 @@ private static final class CueInfoBuilder {
967
968
private int horizontalAnchor ;
968
969
private int anchorId ;
969
970
private int rowCount ;
970
- private boolean rowLock ;
971
971
private int justification ;
972
972
private int windowStyleId ;
973
973
private int penStyleId ;
@@ -1003,7 +1003,6 @@ public void reset() {
1003
1003
horizontalAnchor = 0 ;
1004
1004
anchorId = 0 ;
1005
1005
rowCount = MAXIMUM_ROW_COUNT ;
1006
- rowLock = true ;
1007
1006
justification = JUSTIFICATION_LEFT ;
1008
1007
windowStyleId = 0 ;
1009
1008
penStyleId = 0 ;
@@ -1037,20 +1036,16 @@ public boolean isVisible() {
1037
1036
1038
1037
public void defineWindow (
1039
1038
boolean visible ,
1040
- boolean rowLock ,
1041
- boolean columnLock ,
1042
1039
int priority ,
1043
1040
boolean relativePositioning ,
1044
1041
int verticalAnchor ,
1045
1042
int horizontalAnchor ,
1046
1043
int rowCount ,
1047
- int columnCount ,
1048
1044
int anchorId ,
1049
1045
int windowStyleId ,
1050
1046
int penStyleId ) {
1051
1047
this .defined = true ;
1052
1048
this .visible = visible ;
1053
- this .rowLock = rowLock ;
1054
1049
this .priority = priority ;
1055
1050
this .relativePositioning = relativePositioning ;
1056
1051
this .verticalAnchor = verticalAnchor ;
@@ -1062,14 +1057,12 @@ public void defineWindow(
1062
1057
this .rowCount = rowCount + 1 ;
1063
1058
1064
1059
// Trim any rolled up captions that are no longer valid, if applicable.
1065
- while (( rowLock && ( rolledUpCaptions .size () >= this .rowCount ))
1066
- || ( rolledUpCaptions .size () >= MAXIMUM_ROW_COUNT ) ) {
1060
+ while (rolledUpCaptions .size () >= this .rowCount
1061
+ || rolledUpCaptions .size () >= MAXIMUM_ROW_COUNT ) {
1067
1062
rolledUpCaptions .remove (0 );
1068
1063
}
1069
1064
}
1070
1065
1071
- // TODO: Add support for column lock and count.
1072
-
1073
1066
if (windowStyleId != 0 && this .windowStyleId != windowStyleId ) {
1074
1067
this .windowStyleId = windowStyleId ;
1075
1068
// windowStyleId is 1-based.
@@ -1231,8 +1224,8 @@ public void append(char text) {
1231
1224
backgroundColorStartPosition = 0 ;
1232
1225
}
1233
1226
1234
- while (( rowLock && ( rolledUpCaptions .size () >= rowCount ))
1235
- || ( rolledUpCaptions .size () >= MAXIMUM_ROW_COUNT ) ) {
1227
+ while (rolledUpCaptions .size () >= rowCount
1228
+ || rolledUpCaptions .size () >= MAXIMUM_ROW_COUNT ) {
1236
1229
rolledUpCaptions .remove (0 );
1237
1230
}
1238
1231
} else {
0 commit comments