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
cac16f16
authored
Sep 21, 2017
by
yqritc
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
remove keep alive check for updating primary url to avoid redundant playlist loading
parent
ff2ece56
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
13 deletions
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/playlist/HlsPlaylistTracker.java
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/playlist/HlsPlaylistTracker.java
View file @
cac16f16
...
...
@@ -112,11 +112,6 @@ public final class HlsPlaylistTracker implements Loader.Callback<ParsingLoadable
* which an unchanging playlist is considered stuck.
*/
private
static
final
double
PLAYLIST_STUCK_TARGET_DURATION_COEFFICIENT
=
3.5
;
/**
* The minimum number of milliseconds that a url is kept as primary url, if no
* {@link #getPlaylistSnapshot} call is made for that url.
*/
private
static
final
long
PRIMARY_URL_KEEPALIVE_MS
=
15000
;
private
final
Uri
initialPlaylistUri
;
private
final
HlsDataSourceFactory
dataSourceFactory
;
...
...
@@ -205,7 +200,7 @@ public final class HlsPlaylistTracker implements Loader.Callback<ParsingLoadable
*/
public
HlsMediaPlaylist
getPlaylistSnapshot
(
HlsUrl
url
)
{
HlsMediaPlaylist
snapshot
=
playlistBundles
.
get
(
url
).
getPlaylistSnapshot
();
if
(
snapshot
!=
null
)
{
if
(
url
!=
primaryHlsUrl
&&
snapshot
!=
null
)
{
maybeSetPrimaryUrl
(
url
);
}
return
snapshot
;
...
...
@@ -349,13 +344,9 @@ public final class HlsPlaylistTracker implements Loader.Callback<ParsingLoadable
// the last primary snapshot contains an end tag.
return
;
}
MediaPlaylistBundle
currentPrimaryBundle
=
playlistBundles
.
get
(
primaryHlsUrl
);
long
primarySnapshotAccessAgeMs
=
SystemClock
.
elapsedRealtime
()
-
currentPrimaryBundle
.
lastSnapshotAccessTimeMs
;
if
(
primarySnapshotAccessAgeMs
>
PRIMARY_URL_KEEPALIVE_MS
)
{
primaryHlsUrl
=
url
;
playlistBundles
.
get
(
primaryHlsUrl
).
loadPlaylist
();
}
primaryHlsUrl
=
url
;
playlistBundles
.
get
(
primaryHlsUrl
).
loadPlaylist
();
}
private
void
createBundles
(
List
<
HlsUrl
>
urls
)
{
...
...
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