Commit b46f64ab by Oliver Woodman

Merge pull request #7064 from davibe:enhancement/6907

PiperOrigin-RevId: 300330109
parents 0175dd44 8908cc85
......@@ -76,7 +76,10 @@
MediaSources factories.
* Downloads: Merge downloads in `SegmentDownloader` to improve overall
download speed ([#5978](https://github.com/google/ExoPlayer/issues/5978)).
* DASH: Parse period `AssetIdentifier` elements.
* DASH:
* Update the manifest URI to avoid repeated HTTP redirects
([#6907](https://github.com/google/ExoPlayer/issues/6907)).
* Parse period `AssetIdentifier` elements.
* MP3: Add `IndexSeeker` for accurate seeks in VBR streams
([#6787](https://github.com/google/ExoPlayer/issues/6787)). This seeker is
enabled by passing `FLAG_ENABLE_INDEX_SEEKING` to the `Mp3Extractor`. It may
......
......@@ -814,15 +814,18 @@ public final class DashMediaSource extends BaseMediaSource {
manifestLoadPending &= manifest.dynamic;
manifestLoadStartTimestampMs = elapsedRealtimeMs - loadDurationMs;
manifestLoadEndTimestampMs = elapsedRealtimeMs;
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) {
manifestUri = manifest.location;
}
synchronized (manifestUriLock) {
// Checks whether replaceManifestUri(Uri) was called to manually replace the URI between the
// start and end of this load. If it was then isSameUriInstance evaluates to false, and we
// prefer the manual replacement to one derived from the previous request.
@SuppressWarnings("ReferenceEquality")
boolean isSameUriInstance = loadable.dataSpec.uri == manifestUri;
if (isSameUriInstance) {
// Replace the manifest URI with one specified by a manifest Location element (if present),
// or with the final (possibly redirected) URI. This follows the recommendation in
// DASH-IF-IOP 4.3, section 3.2.15.3. See: https://dashif.org/docs/DASH-IF-IOP-v4.3.pdf.
manifestUri = manifest.location != null ? manifest.location : loadable.getUri();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment