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
b95b0aad
authored
Jun 03, 2015
by
ood_tsen
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
clean the list while forward seek.
parent
fd2ebc76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
library/src/main/java/com/google/android/exoplayer/text/tx3g/TextParser.java
library/src/main/java/com/google/android/exoplayer/text/tx3g/TextParser.java
View file @
b95b0aad
...
...
@@ -54,10 +54,18 @@ public class TextParser implements SubtitleParser {
SubtitleData
cue
=
new
SubtitleData
(
startTimeUs
,
text
);
while
(
subtitleList
.
size
()
>
MAX_SUBTITLE_COUNT
)
{
subtitleList
.
remove
(
0
);
}
//try to resize the list.
if
(
subtitleList
.
size
()
>
0
)
{
long
lastTimeUs
=
subtitleList
.
get
(
subtitleList
.
size
()
-
1
).
startTimePosUs
;
if
(
startTimeUs
<
lastTimeUs
)
{
//when forward seek
subtitleList
.
clear
();
}
while
(
subtitleList
.
size
()
>
MAX_SUBTITLE_COUNT
)
{
subtitleList
.
remove
(
0
);
}
}
subtitleList
.
add
(
cue
);
Collections
.
sort
(
subtitleList
,
new
Comparator
<
SubtitleData
>()
{
...
...
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