Don't resolve UtcTiming element for static manifests

It doesn't do anything useful in this case.

PiperOrigin-RevId: 223516909
This commit is contained in:
olly 2018-11-30 16:08:41 +00:00 committed by Oliver Woodman
parent ea483f8c8e
commit beae7c9df5
2 changed files with 9 additions and 9 deletions

View File

@ -65,7 +65,7 @@ import java.util.List;
private final DashChunkSource.Factory chunkSourceFactory;
private final @Nullable TransferListener transferListener;
private final LoadErrorHandlingPolicy loadErrorHandlingPolicy;
private final long elapsedRealtimeOffset;
private final long elapsedRealtimeOffsetMs;
private final LoaderErrorThrower manifestLoaderErrorThrower;
private final Allocator allocator;
private final TrackGroupArray trackGroups;
@ -93,7 +93,7 @@ import java.util.List;
@Nullable TransferListener transferListener,
LoadErrorHandlingPolicy loadErrorHandlingPolicy,
EventDispatcher eventDispatcher,
long elapsedRealtimeOffset,
long elapsedRealtimeOffsetMs,
LoaderErrorThrower manifestLoaderErrorThrower,
Allocator allocator,
CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory,
@ -105,7 +105,7 @@ import java.util.List;
this.transferListener = transferListener;
this.loadErrorHandlingPolicy = loadErrorHandlingPolicy;
this.eventDispatcher = eventDispatcher;
this.elapsedRealtimeOffset = elapsedRealtimeOffset;
this.elapsedRealtimeOffsetMs = elapsedRealtimeOffsetMs;
this.manifestLoaderErrorThrower = manifestLoaderErrorThrower;
this.allocator = allocator;
this.compositeSequenceableLoaderFactory = compositeSequenceableLoaderFactory;
@ -593,7 +593,7 @@ import java.util.List;
trackGroupInfo.adaptationSetIndices,
selection,
trackGroupInfo.trackType,
elapsedRealtimeOffset,
elapsedRealtimeOffsetMs,
enableEventMessageTrack,
enableCea608Track,
trackPlayerEmsgHandler,

View File

@ -710,17 +710,17 @@ public final class DashMediaSource extends BaseMediaSource {
loadable.bytesLoaded());
DashManifest newManifest = loadable.getResult();
int periodCount = manifest == null ? 0 : manifest.getPeriodCount();
int oldPeriodCount = manifest == null ? 0 : manifest.getPeriodCount();
int removedPeriodCount = 0;
long newFirstPeriodStartTimeMs = newManifest.getPeriod(0).startMs;
while (removedPeriodCount < periodCount
while (removedPeriodCount < oldPeriodCount
&& manifest.getPeriod(removedPeriodCount).startMs < newFirstPeriodStartTimeMs) {
removedPeriodCount++;
}
if (newManifest.dynamic) {
boolean isManifestStale = false;
if (periodCount - removedPeriodCount > newManifest.getPeriodCount()) {
if (oldPeriodCount - removedPeriodCount > newManifest.getPeriodCount()) {
// 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
@ -770,8 +770,8 @@ public final class DashMediaSource extends BaseMediaSource {
}
}
if (periodCount == 0) {
if (manifest.utcTiming != null) {
if (oldPeriodCount == 0) {
if (manifest.dynamic && manifest.utcTiming != null) {
resolveUtcTimingElement(manifest.utcTiming);
} else {
processManifest(true);