Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
799bf167
authored
Nov 23, 2018
by
olly
Committed by
Oliver Woodman
Nov 23, 2018
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Pull reading of data bytes back above if(...){continue} clauses
PiperOrigin-RevId: 222633838
parent
e2e1c459
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea608Decoder.java
library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea608Decoder.java
View file @
799bf167
...
...
@@ -293,28 +293,27 @@ public final class Cea608Decoder extends CeaDecoder {
boolean
captionDataProcessed
=
false
;
boolean
isRepeatableControl
=
false
;
while
(
ccData
.
bytesLeft
()
>=
packetLength
)
{
byte
cc
Data
Header
=
packetLength
==
2
?
CC_IMPLICIT_DATA_HEADER
byte
ccHeader
=
packetLength
==
2
?
CC_IMPLICIT_DATA_HEADER
:
(
byte
)
ccData
.
readUnsignedByte
();
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.
if
((
cc
Data
Header
&
CC_TYPE_FLAG
)
!=
0
)
{
if
((
ccHeader
&
CC_TYPE_FLAG
)
!=
0
)
{
// Do not process anything that is not part of the 608 byte stream.
continue
;
}
if
((
selectedField
==
1
&&
(
cc
Data
Header
&
CC_FIELD_FLAG
)
!=
NTSC_CC_FIELD_1
)
||
(
selectedField
==
2
&&
(
cc
Data
Header
&
CC_FIELD_FLAG
)
!=
NTSC_CC_FIELD_2
))
{
if
((
selectedField
==
1
&&
(
ccHeader
&
CC_FIELD_FLAG
)
!=
NTSC_CC_FIELD_1
)
||
(
selectedField
==
2
&&
(
ccHeader
&
CC_FIELD_FLAG
)
!=
NTSC_CC_FIELD_2
))
{
// Do not process packets not within the selected field.
continue
;
}
int
ccByte1
=
ccData
.
readUnsignedByte
();
int
ccByte2
=
ccData
.
readUnsignedByte
();
// Strip the parity bit from each byte to get CC data.
byte
ccData1
=
(
byte
)
(
ccByte1
&
0x7F
);
byte
ccData2
=
(
byte
)
(
ccByte2
&
0x7F
);
...
...
@@ -324,9 +323,9 @@ public final class Cea608Decoder extends CeaDecoder {
continue
;
}
if
((
cc
Data
Header
&
CC_VALID_FLAG
)
!=
CC_VALID_FLAG
)
{
if
((
ccHeader
&
CC_VALID_FLAG
)
!=
CC_VALID_FLAG
)
{
if
(
captionValid
)
{
// The encoder has flipped the validity bit to indicate c
losed captions are being turned
.
// The encoder has flipped the validity bit to indicate c
aptions are being turned off
.
resetCueBuilders
();
captionValid
=
false
;
captionDataProcessed
=
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment