From 2603734ed6cd4adf22e3b2fa3c525e15c6c076db 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 a5a22bf2c85..ccfacec71ea 100644 --- a/src/manifest/classes/manifest.ts +++ b/src/manifest/classes/manifest.ts @@ -623,6 +623,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;