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
97aaee6d
authored
Jun 19, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix crash introduced by previous change.
parent
b8df8ecb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
library/src/main/java/com/google/android/exoplayer/hls/HlsSampleSource.java
library/src/main/java/com/google/android/exoplayer/hls/HlsSampleSource.java
View file @
97aaee6d
...
...
@@ -353,18 +353,17 @@ public class HlsSampleSource implements SampleSource, SampleSourceReader, Loader
@Override
public
void
onLoadCompleted
(
Loadable
loadable
)
{
Assertions
.
checkState
(
loadable
==
currentLoadable
);
long
now
=
SystemClock
.
elapsedRealtime
();
long
loadDurationMs
=
now
-
currentLoadStartTimeMs
;
if
(
currentTsLoadable
!=
null
)
{
previousTsLoadable
=
currentTsLoadable
;
currentTsLoadable
=
null
;
}
chunkSource
.
onChunkLoadCompleted
(
currentLoadable
);
if
(
isTsChunk
(
currentLoadable
))
{
TsChunk
tsChunk
=
(
TsChunk
)
loadable
;
loadingFinished
=
tsChunk
.
isLastChunk
;
notifyLoadCompleted
(
currentLoadable
.
bytesLoaded
(),
tsChunk
.
type
,
tsChunk
.
trigger
,
tsChunk
.
format
,
tsChunk
.
startTimeUs
,
tsChunk
.
endTimeUs
,
now
,
loadDurationMs
);
Assertions
.
checkState
(
currentLoadable
==
currentTsLoadable
);
loadingFinished
=
currentTsLoadable
.
isLastChunk
;
previousTsLoadable
=
currentTsLoadable
;
notifyLoadCompleted
(
currentLoadable
.
bytesLoaded
(),
currentTsLoadable
.
type
,
currentTsLoadable
.
trigger
,
currentTsLoadable
.
format
,
currentTsLoadable
.
startTimeUs
,
currentTsLoadable
.
endTimeUs
,
now
,
loadDurationMs
);
}
else
{
notifyLoadCompleted
(
currentLoadable
.
bytesLoaded
(),
currentLoadable
.
type
,
currentLoadable
.
trigger
,
currentLoadable
.
format
,
-
1
,
-
1
,
now
,
loadDurationMs
);
...
...
@@ -534,10 +533,10 @@ public class HlsSampleSource implements SampleSource, SampleSourceReader, Loader
private
long
getNextLoadPositionUs
()
{
if
(
isPendingReset
())
{
return
pendingResetPositionUs
;
}
else
if
(
loader
.
isLoading
())
{
return
currentTsLoadable
.
isLastChunk
?
-
1
:
currentTsLoadable
.
endTimeUs
;
}
else
{
return
previousTsLoadable
.
isLastChunk
?
-
1
:
previousTsLoadable
.
endTimeUs
;
return
currentTsLoadable
!=
null
?
(
currentTsLoadable
.
isLastChunk
?
-
1
:
currentTsLoadable
.
endTimeUs
)
:
(
previousTsLoadable
.
isLastChunk
?
-
1
:
previousTsLoadable
.
endTimeUs
);
}
}
...
...
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