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
35fa5e2e
authored
Aug 31, 2016
by
Rik Heijdens
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fixed foreground color midrow codes being handled as background colors
parent
71d83f3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
library/src/main/java/com/google/android/exoplayer2/text/eia608/Eia608Decoder.java
library/src/main/java/com/google/android/exoplayer2/text/eia608/Eia608Decoder.java
View file @
35fa5e2e
...
@@ -379,7 +379,7 @@ public final class Eia608Decoder implements SubtitleDecoder {
...
@@ -379,7 +379,7 @@ public final class Eia608Decoder implements SubtitleDecoder {
}
}
// Mid row changes.
// Mid row changes.
if
((
ccData1
==
0x11
||
ccData1
==
0x19
)
&&
ccData2
>=
0x20
&&
ccData2
<=
0x2F
)
{
if
((
ccData1
==
0x11
||
ccData1
==
0x19
)
&&
(
ccData2
>=
0x20
&&
ccData2
<=
0x2F
)
)
{
handleMidrowCode
(
ccData1
,
ccData2
);
handleMidrowCode
(
ccData1
,
ccData2
);
}
}
...
@@ -531,13 +531,18 @@ public final class Eia608Decoder implements SubtitleDecoder {
...
@@ -531,13 +531,18 @@ public final class Eia608Decoder implements SubtitleDecoder {
private
void
handleMidrowCode
(
byte
cc1
,
byte
cc2
)
{
private
void
handleMidrowCode
(
byte
cc1
,
byte
cc2
)
{
boolean
transparentOrUnderline
=
(
cc2
&
0x1
)
!=
0
;
boolean
transparentOrUnderline
=
(
cc2
&
0x1
)
!=
0
;
int
attribute
=
cc2
>>
1
&
0xF
;
int
attribute
=
cc2
>>
1
&
0xF
;
if
((
cc1
&
0x1
)
!
=
0
)
{
if
((
cc1
&
0x1
)
=
=
0
)
{
// Background Color
// Background Color
currentCue
.
setCharacterStyle
(
new
BackgroundColorSpan
(
transparentOrUnderline
?
currentCue
.
setCharacterStyle
(
new
BackgroundColorSpan
(
transparentOrUnderline
?
COLOR_MAP
[
attribute
]
&
TRANSPARENCY_MASK
:
COLOR_MAP
[
attribute
]));
COLOR_MAP
[
attribute
]
&
TRANSPARENCY_MASK
:
COLOR_MAP
[
attribute
]));
}
else
{
}
else
{
// Foreground color
if
(
attribute
<
7
)
{
currentCue
.
setCharacterStyle
(
new
ForegroundColorSpan
(
COLOR_MAP
[
attribute
]));
// Foreground color
currentCue
.
setCharacterStyle
(
new
ForegroundColorSpan
(
COLOR_MAP
[
attribute
]));
}
else
{
// Italics
currentCue
.
setCharacterStyle
(
new
StyleSpan
(
STYLE_ITALIC
));
}
if
(
transparentOrUnderline
)
{
if
(
transparentOrUnderline
)
{
// Text should be underlined
// Text should be underlined
currentCue
.
setCharacterStyle
(
new
UnderlineSpan
());
currentCue
.
setCharacterStyle
(
new
UnderlineSpan
());
...
...
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