Skip to content

Commit

Permalink
Don't re-load a Manifest's optional external resource each time if in…
Browse files Browse the repository at this point in the history
…itial failed

While doing some testing on `<UTCTiming>` 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
`<UTCTiming>` 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.
  • Loading branch information
peaBerberian committed Feb 5, 2024
1 parent 1df30a6 commit 650f7d8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/manifest/classes/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 650f7d8

Please sign in to comment.