mirror of
https://github.com/samsonjs/media.git
synced 2026-03-31 10:25:48 +00:00
Fix Cea608 caption valid
PiperOrigin-RevId: 222797622
This commit is contained in:
parent
03101444af
commit
17eadcc433
1 changed files with 4 additions and 4 deletions
|
|
@ -298,7 +298,6 @@ public final class Cea608Decoder extends CeaDecoder {
|
|||
int ccByte1 = ccData.readUnsignedByte();
|
||||
int ccByte2 = ccData.readUnsignedByte();
|
||||
|
||||
// Only examine valid CEA-608 packets
|
||||
// TODO: We're currently ignoring the top 5 marker bits, which should all be 1s according
|
||||
// to the CEA-608 specification. We need to determine if the data should be handled
|
||||
// differently when that is not the case.
|
||||
|
|
@ -323,11 +322,12 @@ public final class Cea608Decoder extends CeaDecoder {
|
|||
continue;
|
||||
}
|
||||
|
||||
if ((ccHeader & CC_VALID_FLAG) != CC_VALID_FLAG) {
|
||||
if (captionValid) {
|
||||
boolean previousCaptionValid = captionValid;
|
||||
captionValid = (ccHeader & CC_VALID_FLAG) == CC_VALID_FLAG;
|
||||
if (!captionValid) {
|
||||
if (previousCaptionValid) {
|
||||
// The encoder has flipped the validity bit to indicate captions are being turned off.
|
||||
resetCueBuilders();
|
||||
captionValid = false;
|
||||
captionDataProcessed = true;
|
||||
}
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue