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
26ea43d2
authored
Jan 22, 2021
by
kim-vde
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge pull request #8415 from TiVo:p-fix-cea708anchor
PiperOrigin-RevId: 352783091
parents
2d3e6d4d
b534097d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
4 deletions
RELEASENOTES.md
library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea708Decoder.java
RELEASENOTES.md
View file @
26ea43d2
...
...
@@ -217,6 +217,10 @@
containers.
*
Fix CEA-708 anchor positioning
(
[
#1807
](
https://github.com/google/ExoPlayer/issues/1807
)
).
*
Fix CEA-708 sequence number discontinuity handling
(
[
#1807
](
https://github.com/google/ExoPlayer/issues/1807
)
).
*
Fix CEA-708 handling of unexpectedly small packets
(
[
#1807
](
https://github.com/google/ExoPlayer/issues/1807
)
).
*
Data sources:
*
Use the user agent of the underlying network stack by default.
*
Metadata retriever:
...
...
library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea708Decoder.java
View file @
26ea43d2
...
...
@@ -145,6 +145,7 @@ public final class Cea708Decoder extends CeaDecoder {
private
final
ParsableByteArray
ccData
;
private
final
ParsableBitArray
serviceBlockPacket
;
private
int
previousSequenceNumber
;
// TODO: Use isWideAspectRatio in decoding.
@SuppressWarnings
({
"unused"
,
"FieldCanBeLocal"
})
private
final
boolean
isWideAspectRatio
;
...
...
@@ -162,6 +163,7 @@ public final class Cea708Decoder extends CeaDecoder {
public
Cea708Decoder
(
int
accessibilityChannel
,
@Nullable
List
<
byte
[]>
initializationData
)
{
ccData
=
new
ParsableByteArray
();
serviceBlockPacket
=
new
ParsableBitArray
();
previousSequenceNumber
=
C
.
INDEX_UNSET
;
selectedServiceNumber
=
accessibilityChannel
==
Format
.
NO_VALUE
?
1
:
accessibilityChannel
;
isWideAspectRatio
=
initializationData
!=
null
...
...
@@ -231,6 +233,18 @@ public final class Cea708Decoder extends CeaDecoder {
finalizeCurrentPacket
();
int
sequenceNumber
=
(
ccData1
&
0xC0
)
>>
6
;
// first 2 bits
if
(
previousSequenceNumber
!=
C
.
INDEX_UNSET
&&
sequenceNumber
!=
(
previousSequenceNumber
+
1
)
%
4
)
{
resetCueBuilders
();
Log
.
w
(
TAG
,
"Sequence number discontinuity. previous="
+
previousSequenceNumber
+
" current="
+
sequenceNumber
);
}
previousSequenceNumber
=
sequenceNumber
;
int
packetSize
=
ccData1
&
0x3F
;
// last 6 bits
if
(
packetSize
==
0
)
{
packetSize
=
64
;
...
...
@@ -270,10 +284,18 @@ public final class Cea708Decoder extends CeaDecoder {
@RequiresNonNull
(
"currentDtvCcPacket"
)
private
void
processCurrentPacket
()
{
if
(
currentDtvCcPacket
.
currentIndex
!=
(
currentDtvCcPacket
.
packetSize
*
2
-
1
))
{
Log
.
w
(
TAG
,
"DtvCcPacket ended prematurely; size is "
+
(
currentDtvCcPacket
.
packetSize
*
2
-
1
)
+
", but current index is "
+
currentDtvCcPacket
.
currentIndex
+
" (sequence number "
+
currentDtvCcPacket
.
sequenceNumber
+
"); ignoring packet"
);
return
;
Log
.
d
(
TAG
,
"DtvCcPacket ended prematurely; size is "
+
(
currentDtvCcPacket
.
packetSize
*
2
-
1
)
+
", but current index is "
+
currentDtvCcPacket
.
currentIndex
+
" (sequence number "
+
currentDtvCcPacket
.
sequenceNumber
+
");"
);
// We've received cc_type=0x03 (packet start) before receiving packetSize byte pairs of data.
// This might indicate a byte pair has been lost, but we'll still attempt to process the data
// we have received.
}
serviceBlockPacket
.
reset
(
currentDtvCcPacket
.
packetData
,
currentDtvCcPacket
.
currentIndex
);
...
...
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