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
b87463a8
authored
Sep 14, 2016
by
Rik Heijdens
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fixed an off by one error and fixed iterating through the cues
parent
26fe1dc2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
library/src/main/java/com/google/android/exoplayer2/text/eia608/Eia608CueBuilder.java
library/src/main/java/com/google/android/exoplayer2/text/eia608/Eia608Decoder.java
library/src/main/java/com/google/android/exoplayer2/text/eia608/Eia608CueBuilder.java
View file @
b87463a8
package
com
.
google
.
android
.
exoplayer2
.
text
.
eia608
;
import
com.google.android.exoplayer2.text.Cue
;
import
com.google.android.exoplayer2.util.Assertions
;
import
android.text.Layout
;
import
android.text.SpannableStringBuilder
;
import
android.text.Spanned
;
...
...
@@ -10,6 +7,9 @@ import android.text.style.CharacterStyle;
import
android.text.style.ForegroundColorSpan
;
import
android.text.style.StyleSpan
;
import
com.google.android.exoplayer2.text.Cue
;
import
com.google.android.exoplayer2.util.Assertions
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
...
...
@@ -73,7 +73,7 @@ import java.util.List;
* @return true if rolling was possible.
*/
public
boolean
rollUp
()
{
if
(
row
<
1
)
{
if
(
row
<
=
1
)
{
return
false
;
}
setRow
(
row
-
1
);
...
...
library/src/main/java/com/google/android/exoplayer2/text/eia608/Eia608Decoder.java
View file @
b87463a8
...
...
@@ -15,6 +15,13 @@
*/
package
com
.
google
.
android
.
exoplayer2
.
text
.
eia608
;
import
android.graphics.Color
;
import
android.graphics.Typeface
;
import
android.text.style.BackgroundColorSpan
;
import
android.text.style.ForegroundColorSpan
;
import
android.text.style.StyleSpan
;
import
android.text.style.UnderlineSpan
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.text.Cue
;
import
com.google.android.exoplayer2.text.SubtitleDecoder
;
...
...
@@ -24,14 +31,8 @@ import com.google.android.exoplayer2.text.SubtitleOutputBuffer;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.ParsableByteArray
;
import
android.graphics.Color
;
import
android.graphics.Typeface
;
import
android.text.style.BackgroundColorSpan
;
import
android.text.style.ForegroundColorSpan
;
import
android.text.style.StyleSpan
;
import
android.text.style.UnderlineSpan
;
import
java.util.Collections
;
import
java.util.Iterator
;
import
java.util.LinkedList
;
import
java.util.TreeSet
;
...
...
@@ -472,10 +473,12 @@ public final class Eia608Decoder implements SubtitleDecoder {
// from memory and from the display. The remaining rows of text are each rolled up into the
// next highest row in the window, leaving the base row blank and ready to accept new text.
if
(
captionMode
==
CC_MODE_ROLL_UP
)
{
for
(
Eia608CueBuilder
cue
:
cues
)
{
Iterator
<
Eia608CueBuilder
>
iterator
=
cues
.
iterator
();
while
(
iterator
.
hasNext
())
{
Eia608CueBuilder
cue
=
iterator
.
next
();
// Roll up all the other rows.
if
(!
cue
.
rollUp
())
{
cues
.
remove
(
cue
);
iterator
.
remove
(
);
}
}
currentCue
=
new
Eia608CueBuilder
();
...
...
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