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
8ee6da1f
authored
Sep 26, 2017
by
ojw28
Committed by
GitHub
Sep 26, 2017
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge pull request #3280 from yqritc/fix-primary-playlist-update
Fix primary hls playlist update
parents
b17a6ba5
455f9fb9
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 @
8ee6da1f
...
...
@@ -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
=
currentPrimaryBundle
.
lastSnapshotAccessTimeMs
-
SystemClock
.
elapsedRealtime
();
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