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
5de7638f
authored
Nov 17, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Handle laggy manifest servers. Don't reprocess discarded manifests twice.
parent
b27dc9b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
library/src/main/java/com/google/android/exoplayer/dash/DashChunkSource.java
library/src/main/java/com/google/android/exoplayer/dash/DashChunkSource.java
View file @
5de7638f
...
...
@@ -121,6 +121,7 @@ public class DashChunkSource implements ChunkSource, Output {
private
final
boolean
live
;
private
MediaPresentationDescription
currentManifest
;
private
MediaPresentationDescription
processedManifest
;
private
ExposedTrack
enabledTrack
;
private
int
nextPeriodHolderIndex
;
private
TimeRange
availableRange
;
...
...
@@ -322,8 +323,11 @@ public class DashChunkSource implements ChunkSource, Output {
}
MediaPresentationDescription
newManifest
=
manifestFetcher
.
getManifest
();
if
(
currentManifest
!=
newManifest
&&
newManifest
!=
null
)
{
if
(
newManifest
!=
null
&&
newManifest
!=
processedManifest
)
{
processManifest
(
newManifest
);
// Manifests may be rejected, so the new manifest may not become the next currentManifest.
// Track a manifest has been processed to avoid processing twice when it was discarded.
processedManifest
=
newManifest
;
}
// TODO: This is a temporary hack to avoid constantly refreshing the MPD in cases where
...
...
@@ -727,6 +731,14 @@ public class DashChunkSource implements ChunkSource, Output {
periodHolders
.
remove
(
periodHolder
.
localIndex
);
}
// After discarding old periods, we should never have more periods than listed in the new
// manifest. That would mean that a previously announced period is no longer advertised. If
// this condition occurs, assume that we are hitting a manifest server that is out of sync and
// behind, discard this manifest, and try again later.
if
(
periodHolders
.
size
()
>
manifest
.
getPeriodCount
())
{
return
;
}
// Update existing periods. Only the first and last periods can change.
try
{
int
periodHolderCount
=
periodHolders
.
size
();
...
...
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