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
6ef8c3a6
authored
Sep 18, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Avoid loading the first HLS segment twice.
Issue: #788
parent
8a723706
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 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 @
6ef8c3a6
...
@@ -191,14 +191,23 @@ public final class HlsSampleSource implements SampleSource, SampleSourceReader,
...
@@ -191,14 +191,23 @@ public final class HlsSampleSource implements SampleSource, SampleSourceReader,
downstreamMediaFormats
[
track
]
=
null
;
downstreamMediaFormats
[
track
]
=
null
;
pendingDiscontinuities
[
track
]
=
false
;
pendingDiscontinuities
[
track
]
=
false
;
downstreamFormat
=
null
;
downstreamFormat
=
null
;
boolean
wasLoadControlRegistered
=
loadControlRegistered
;
if
(!
loadControlRegistered
)
{
if
(!
loadControlRegistered
)
{
loadControl
.
register
(
this
,
bufferSizeContribution
);
loadControl
.
register
(
this
,
bufferSizeContribution
);
loadControlRegistered
=
true
;
loadControlRegistered
=
true
;
}
}
if
(
enabledTrackCount
==
1
)
{
if
(
enabledTrackCount
==
1
)
{
downstreamPositionUs
=
positionUs
;
lastSeekPositionUs
=
positionUs
;
lastSeekPositionUs
=
positionUs
;
restartFrom
(
positionUs
);
if
(
wasLoadControlRegistered
&&
downstreamPositionUs
==
positionUs
)
{
// TODO: Address [Internal: b/21743989] to remove the need for this kind of hack.
// This is the first track to be enabled after preparation and the position is the same as
// was passed to prepare. In this case we can avoid restarting, which would reload the same
// chunks as were loaded during preparation.
maybeStartLoading
();
}
else
{
downstreamPositionUs
=
positionUs
;
restartFrom
(
positionUs
);
}
}
}
}
}
...
...
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