From 650f7d8df68b1ea0af13e066e5d82eb6a1566623 Mon Sep 17 00:00:00 2001 From: Paul Berberian Date: Wed, 31 Jan 2024 15:40:04 +0100 Subject: [PATCH] Don't re-load a Manifest's optional external resource each time if initial failed While doing some testing on `` elements in a DASH MPD, it has been brought to us that if attempts to load an URL linked to it for the initial fetch of the Manifest failed (in which case we fallback to a mode where we don't rely on that element) and if the Manifest has to be refreshed multiple times, then the URL will be accessed every time the Manifest is refreshed, even if just one sucessful attempt would be enough. The issue was very simple to fix, as it was just that a newly obtained `clockOffset` - the actual metadata derived from parsing an `` element, was just not actually copied when updating the base Manifest by its new parsed version. Once that `clockOffset` is set to the base Manifest, that information will be communicated to our Manifest parser when refreshed, so it won't retry to load the clock and continue relying on the one fetched before. --- src/manifest/classes/manifest.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/manifest/classes/manifest.ts b/src/manifest/classes/manifest.ts index 7976fc3a69..126c828025 100644 --- a/src/manifest/classes/manifest.ts +++ b/src/manifest/classes/manifest.ts @@ -622,6 +622,7 @@ export default class Manifest this.isLive = newManifest.isLive; this.isLastPeriodKnown = newManifest.isLastPeriodKnown; this.lifetime = newManifest.lifetime; + this.clockOffset = newManifest.clockOffset; this.suggestedPresentationDelay = newManifest.suggestedPresentationDelay; this.transport = newManifest.transport; this.publishTime = newManifest.publishTime;