diff --git a/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashMediaSource.java b/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashMediaSource.java index 4a0a79da2a..9005190f6a 100644 --- a/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashMediaSource.java +++ b/library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashMediaSource.java @@ -792,25 +792,20 @@ public final class DashMediaSource extends BaseMediaSource { manifestLoadStartTimestampMs = elapsedRealtimeMs - loadDurationMs; manifestLoadEndTimestampMs = elapsedRealtimeMs; boolean isRedirect = !loadable.getUri().equals(this.manifestUri); - if (isRedirect) { + boolean hasLocation = manifest.location != null; + + if (isRedirect || hasLocation) { synchronized (manifestUriLock) { // This condition checks that replaceManifestUri wasn't called between the start and end of // this load. If it was, we ignore the manifest location and prefer the manual replacement. @SuppressWarnings("ReferenceEquality") boolean isSameUriInstance = loadable.dataSpec.uri == manifestUri; if (isSameUriInstance) { - manifestUri = loadable.getUri(); - } - } - } - if (manifest.location != null) { - synchronized (manifestUriLock) { - // This condition checks that replaceManifestUri wasn't called between the start and end of - // this load. If it was, we ignore the manifest location and prefer the manual replacement. - @SuppressWarnings("ReferenceEquality") - boolean isSameUriInstance = loadable.dataSpec.uri == manifestUri; - if (isSameUriInstance || isRedirect) { - manifestUri = manifest.location; + if (hasLocation) { + manifestUri = manifest.location; + } else { + manifestUri = loadable.getUri(); + } } } }