@blockcast/mmt-container 0.4.0 → 0.4.1-main.2e0aa69d293d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -21
- package/dist/align.d.ts +24 -18
- package/dist/align.d.ts.map +1 -1
- package/dist/align.js +23 -4
- package/dist/align.js.map +2 -2
- package/dist/browser-runtime.js +5070 -908
- package/dist/browser-runtime.js.map +4 -4
- package/dist/carp-catalog.d.ts +76 -39
- package/dist/carp-catalog.d.ts.map +1 -1
- package/dist/carp-catalog.js +321 -205
- package/dist/carp-catalog.js.map +3 -3
- package/dist/catalog-fec-params.d.ts +12 -4
- package/dist/catalog-fec-params.d.ts.map +1 -1
- package/dist/catalog-fec-params.js +40 -17
- package/dist/catalog-fec-params.js.map +3 -3
- package/dist/catalog-network-source.d.ts +28 -7
- package/dist/catalog-network-source.d.ts.map +1 -1
- package/dist/catalog-network-source.js +21 -1
- package/dist/catalog-network-source.js.map +2 -2
- package/dist/catalog-validator.d.ts +4 -3
- package/dist/catalog-validator.d.ts.map +1 -1
- package/dist/catalog-validator.js +0 -29
- package/dist/catalog-validator.js.map +3 -3
- package/dist/cmcd-producer.d.ts +13 -1
- package/dist/cmcd-producer.d.ts.map +1 -1
- package/dist/cmcd-producer.js +14 -0
- package/dist/cmcd-producer.js.map +2 -2
- package/dist/delivery-catalog.js +115 -235
- package/dist/delivery-catalog.js.map +4 -4
- package/dist/fec-manager.d.ts +113 -1
- package/dist/fec-manager.d.ts.map +1 -1
- package/dist/fec-manager.js +464 -66
- package/dist/fec-manager.js.map +4 -4
- package/dist/fec-state.d.ts +2 -1
- package/dist/fec-state.d.ts.map +1 -1
- package/dist/fec-state.js +18 -3
- package/dist/fec-state.js.map +3 -3
- package/dist/fec-worker-setup.d.ts +10 -0
- package/dist/fec-worker-setup.d.ts.map +1 -1
- package/dist/fec-worker-setup.js +15 -4
- package/dist/fec-worker-setup.js.map +2 -2
- package/dist/held-layer-admission.d.ts +58 -0
- package/dist/held-layer-admission.d.ts.map +1 -0
- package/dist/held-layer-admission.js +105 -0
- package/dist/held-layer-admission.js.map +7 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +2 -2
- package/dist/iso-block-locator.d.ts +39 -1
- package/dist/iso-block-locator.d.ts.map +1 -1
- package/dist/iso-block-locator.js +109 -17
- package/dist/iso-block-locator.js.map +3 -3
- package/dist/mfu-reassembler.js +21 -13
- package/dist/mfu-reassembler.js.map +2 -2
- package/dist/mmtp-container-parser.d.ts.map +1 -1
- package/dist/mmtp-container-parser.js +93 -22
- package/dist/mmtp-container-parser.js.map +2 -2
- package/dist/mmtp-container-parser.no-modules.js +3692 -1213
- package/dist/mmtp-container-parser.no-modules.js.map +4 -4
- package/dist/mmtp-decode-pipeline.js +93 -22
- package/dist/mmtp-decode-pipeline.js.map +2 -2
- package/dist/mmtp-fec-session.d.ts +192 -0
- package/dist/mmtp-fec-session.d.ts.map +1 -0
- package/dist/mmtp-fec-session.js +640 -0
- package/dist/mmtp-fec-session.js.map +7 -0
- package/dist/mmtp-router.d.ts +101 -32
- package/dist/mmtp-router.d.ts.map +1 -1
- package/dist/mmtp-router.js +422 -189
- package/dist/mmtp-router.js.map +2 -2
- package/dist/multicast-auth-catalog.d.ts +94 -92
- package/dist/multicast-auth-catalog.d.ts.map +1 -1
- package/dist/multicast-auth-catalog.js +746 -131
- package/dist/multicast-auth-catalog.js.map +4 -4
- package/dist/multicast-input.d.ts +31 -8
- package/dist/multicast-input.d.ts.map +1 -1
- package/dist/multicast-input.js +299 -35
- package/dist/multicast-input.js.map +3 -3
- package/dist/multicast-manager.d.ts +140 -12
- package/dist/multicast-manager.d.ts.map +1 -1
- package/dist/multicast-manager.js +4104 -605
- package/dist/multicast-manager.js.map +4 -4
- package/dist/multicast-transport.d.ts +16 -3
- package/dist/multicast-transport.d.ts.map +1 -1
- package/dist/multicast-transport.js +127 -240
- package/dist/multicast-transport.js.map +4 -4
- package/dist/multicast-unwrap.js +21 -13
- package/dist/multicast-unwrap.js.map +2 -2
- package/dist/no-modules.d.ts +5 -3
- package/dist/no-modules.d.ts.map +1 -1
- package/dist/no-modules.js +3643 -1197
- package/dist/no-modules.js.map +4 -4
- package/dist/phase14-catalog-override.d.ts +1 -1
- package/dist/phase14-catalog-override.d.ts.map +1 -1
- package/dist/phase14-catalog-override.js +2 -2
- package/dist/phase14-catalog-override.js.map +2 -2
- package/dist/repair-fetch.d.ts +90 -6
- package/dist/repair-fetch.d.ts.map +1 -1
- package/dist/repair-fetch.js +160 -32
- package/dist/repair-fetch.js.map +3 -3
- package/dist/repair-layers.d.ts +2 -0
- package/dist/repair-layers.d.ts.map +1 -1
- package/dist/repair-layers.js +19 -2
- package/dist/repair-layers.js.map +2 -2
- package/dist/sample-combiner.d.ts +7 -1
- package/dist/sample-combiner.d.ts.map +1 -1
- package/dist/sample-combiner.js +14 -2
- package/dist/sample-combiner.js.map +2 -2
- package/dist/signaling.d.ts +2 -2
- package/dist/signaling.d.ts.map +1 -1
- package/dist/signaling.js +3 -3
- package/dist/signaling.js.map +2 -2
- package/dist/switching-set-alignment.d.ts +1 -1
- package/dist/switching-set-alignment.js.map +1 -1
- package/dist/timestamp-codec.js +21 -13
- package/dist/timestamp-codec.js.map +2 -2
- package/dist/wasm-mfu-reassembler.js.map +1 -1
- package/dist/wasm-mmtp-container-parser.js +93 -22
- package/dist/wasm-mmtp-container-parser.js.map +2 -2
- package/package.json +6 -18
- package/schemas/catalog.schema.json +133 -38
- package/src/align.ts +52 -21
- package/src/carp-catalog.ts +188 -68
- package/src/catalog-fec-params.ts +28 -3
- package/src/catalog-network-source.ts +49 -7
- package/src/catalog-validator.ts +4 -11
- package/src/cmcd-producer.ts +23 -1
- package/src/fec-manager.ts +378 -63
- package/src/fec-state.ts +11 -4
- package/src/fec-worker-setup.ts +30 -2
- package/src/held-layer-admission.ts +161 -0
- package/src/index.ts +32 -19
- package/src/iso-block-locator.ts +110 -7
- package/src/mmtp-container-parser.ts +75 -7
- package/src/mmtp-fec-session.ts +606 -0
- package/src/mmtp-router.ts +453 -236
- package/src/multicast-auth-catalog.ts +196 -231
- package/src/multicast-input.ts +148 -124
- package/src/multicast-manager.ts +447 -53
- package/src/multicast-transport.ts +23 -5
- package/src/no-modules.ts +8 -7
- package/src/phase14-catalog-override.ts +3 -3
- package/src/repair-fetch.ts +306 -42
- package/src/repair-layers.ts +22 -2
- package/src/sample-combiner.ts +15 -2
- package/src/signaling.ts +2 -2
- package/src/switching-set-alignment.ts +1 -1
- package/test-vectors/align.json +108 -32
- package/test-vectors/bc-provenance-v2.json +1526 -0
- package/test-vectors/catalog/README.md +71 -4
- package/test-vectors/catalog/negative/fec-block-profile-missing.json +1 -1
- package/test-vectors/catalog/negative/fec-block-profile-retired.json +1 -1
- package/test-vectors/catalog/negative/fec-block-profile-unknown.json +1 -1
- package/test-vectors/catalog/negative/fec-iso-symbol-size-below-floor.json +28 -0
- package/test-vectors/catalog/negative/fec-reed-solomon-iso-symbol-size-13.json +28 -0
- package/test-vectors/catalog/negative/fec-reed-solomon-k-plus-p-over-255.json +39 -0
- package/test-vectors/catalog/negative/fec-reed-solomon-overlay-over-255.json +40 -0
- package/test-vectors/catalog/negative/fec-repair-overlay-source-symbols-zero.json +43 -0
- package/test-vectors/catalog/negative/fec-repair-symbols-zero.json +28 -0
- package/test-vectors/catalog/negative/fec-source-symbols-zero.json +28 -0
- package/test-vectors/catalog/negative/fec-symbol-size-zero.json +28 -0
- package/test-vectors/catalog/negative/init-data-inline-without-data.json +22 -0
- package/test-vectors/catalog/negative/mmtp-mode-mpu.json +15 -0
- package/test-vectors/catalog/negative/multicast-amt-dns-without-relay.json +37 -0
- package/test-vectors/catalog/negative/multicast-amt-driad-with-relay.json +38 -0
- package/test-vectors/catalog/negative/multicast-auth-asm-missing-sender-address.json +77 -0
- package/test-vectors/catalog/negative/multicast-auth-duplicate-first-epoch.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-duplicate-kid.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-auth-without-object-auth.json +38 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-missing-auth.json +49 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-missing-bandwidth.json +55 -0
- package/test-vectors/catalog/negative/multicast-auth-manifest-port-equals-port.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-manifest-timer-out-of-range.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-max-auth-delay-above-max.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-max-auth-delay-below-min.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-root-dotted-key.json +55 -0
- package/test-vectors/catalog/negative/multicast-auth-sender-address-on-ssm.json +57 -0
- package/test-vectors/catalog/negative/multicast-auth-version-1.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-version-3.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-version-missing.json +55 -0
- package/test-vectors/catalog/negative/multicast-endpoint-foreign-namespace-track.json +44 -0
- package/test-vectors/catalog/negative/multicast-endpoint-protocol-amt.json +38 -0
- package/test-vectors/catalog/negative/multicast-endpoint-protocol-atsc3.json +38 -0
- package/test-vectors/catalog/negative/presentation-anchor-unsafe.json +16 -0
- package/test-vectors/catalog/positive/fec-algorithm-unimplemented.json +29 -0
- package/test-vectors/catalog/positive/fec-iso-ssbg1.json +1 -1
- package/test-vectors/catalog/positive/fec-multicast.json +1 -1
- package/test-vectors/catalog/positive/fec-reed-solomon-layered.json +50 -0
- package/test-vectors/catalog/positive/mmt01-12-1-init-ref-anchor.json +29 -0
- package/test-vectors/catalog/positive/multicast-amt-discovery-omitted.json +37 -0
- package/test-vectors/catalog/positive/multicast-amt-dns-relay.json +38 -0
- package/test-vectors/catalog/positive/multicast-amt-manual-relay.json +3 -3
- package/test-vectors/catalog/{negative/multicast-endpoint-missing-protocol-and-source.json → positive/multicast-asm-unprotected.json} +10 -5
- package/test-vectors/catalog/positive/multicast-auth-asm-sender.json +78 -0
- package/test-vectors/catalog/positive/multicast-auth-rotation.json +39 -38
- package/test-vectors/catalog/positive/multicast-draft01-4-1-example.json +81 -0
- package/test-vectors/catalog/positive/multicast-draft01-7-2-6-example.json +70 -0
- package/test-vectors/catalog/positive/presentation-anchor-negative.json +27 -0
- package/test-vectors/catalog/section-codes.json +31 -1
- package/test-vectors/catalog-multicast-auth-v1.json +38 -20
- package/test-vectors/catalog-validation.json +101 -5
- package/test-vectors/catalog-validator-public-api.mjs +14 -9
- package/test-vectors/generate-bc-provenance-v2.mjs +252 -0
- package/dist/fec-codec.d.ts +0 -32
- package/dist/fec-codec.d.ts.map +0 -1
- package/dist/fec-codec.js +0 -47
- package/dist/fec-codec.js.map +0 -7
- package/dist/manifest-auth-plan.d.ts +0 -30
- package/dist/manifest-auth-plan.d.ts.map +0 -1
- package/dist/manifest-auth-plan.js +0 -1266
- package/dist/manifest-auth-plan.js.map +0 -7
- package/dist/source-auth.d.ts +0 -2
- package/dist/source-auth.d.ts.map +0 -1
- package/dist/source-auth.js +0 -1209
- package/dist/source-auth.js.map +0 -7
- package/src/fec-codec.ts +0 -61
- package/src/manifest-auth-plan.ts +0 -107
- package/src/source-auth.ts +0 -1
- package/test-vectors/generate-source-auth-fixture.mjs +0 -114
- package/test-vectors/source-auth-v1.json +0 -61
package/dist/fec-manager.js
CHANGED
|
@@ -186,16 +186,6 @@ var ALL_ROLES = Object.freeze(["video", "audio"]);
|
|
|
186
186
|
|
|
187
187
|
// src/iso-block-locator.ts
|
|
188
188
|
var IsoBlockLocator = class _IsoBlockLocator {
|
|
189
|
-
/** Known blocks and spans, in serial order of their start. */
|
|
190
|
-
#blocks = [];
|
|
191
|
-
/** Held first-arrival sources whose block no repair has stated yet. */
|
|
192
|
-
#held = /* @__PURE__ */ new Map();
|
|
193
|
-
/** End of contiguous coverage: the SS_ID the next unknown block starts at. */
|
|
194
|
-
#coverageEnd;
|
|
195
|
-
#kMax;
|
|
196
|
-
#retentionBlocks;
|
|
197
|
-
#heldEvicted = 0;
|
|
198
|
-
#newest;
|
|
199
189
|
/**
|
|
200
190
|
* @param kMax the catalog maximum K (`sourceSymbols`), the bound on SSB_length.
|
|
201
191
|
* @param retentionBlocks how many blocks behind the newest position the
|
|
@@ -203,12 +193,35 @@ var IsoBlockLocator = class _IsoBlockLocator {
|
|
|
203
193
|
* no locator exists without retention.
|
|
204
194
|
*/
|
|
205
195
|
constructor(kMax, retentionBlocks) {
|
|
196
|
+
/** Known blocks and spans, in serial order of their start. */
|
|
197
|
+
this.#blocks = [];
|
|
198
|
+
/** Held first-arrival sources whose block no repair has stated yet. */
|
|
199
|
+
this.#held = /* @__PURE__ */ new Map();
|
|
200
|
+
this.#heldEvicted = 0;
|
|
201
|
+
/** Pending holes (see `deferIncompleteGaps`): unstated, sources still held. */
|
|
202
|
+
this.#holes = [];
|
|
203
|
+
/**
|
|
204
|
+
* Keep a gap that is missing a source as a pending hole rather than a span,
|
|
205
|
+
* so a repair FETCHed for it (draft-ramadan-moq-fec §7.5) can still state
|
|
206
|
+
* its blocks. Set only while a range repair scheduler is wired; its owner
|
|
207
|
+
* must close every hole it is told about (`closeHolesWithin`).
|
|
208
|
+
*/
|
|
209
|
+
this.deferIncompleteGaps = false;
|
|
206
210
|
if (!Number.isSafeInteger(kMax) || kMax <= 0) {
|
|
207
211
|
throw new Error(`[IsoBlockLocator] maximum K must be a positive integer (got ${kMax})`);
|
|
208
212
|
}
|
|
209
213
|
this.#kMax = kMax;
|
|
210
214
|
this.#retentionBlocks = _IsoBlockLocator.#checkedRetention(retentionBlocks);
|
|
211
215
|
}
|
|
216
|
+
#blocks;
|
|
217
|
+
#held;
|
|
218
|
+
/** End of contiguous coverage: the SS_ID the next unknown block starts at. */
|
|
219
|
+
#coverageEnd;
|
|
220
|
+
#kMax;
|
|
221
|
+
#retentionBlocks;
|
|
222
|
+
#heldEvicted;
|
|
223
|
+
#newest;
|
|
224
|
+
#holes;
|
|
212
225
|
static #checkedRetention(retentionBlocks) {
|
|
213
226
|
if (!Number.isSafeInteger(retentionBlocks) || retentionBlocks <= 0) {
|
|
214
227
|
throw new Error(
|
|
@@ -271,6 +284,14 @@ var IsoBlockLocator = class _IsoBlockLocator {
|
|
|
271
284
|
}
|
|
272
285
|
return null;
|
|
273
286
|
}
|
|
287
|
+
/** Number of pending holes. */
|
|
288
|
+
get holeCount() {
|
|
289
|
+
return this.#holes.length;
|
|
290
|
+
}
|
|
291
|
+
/** The stated block (never a span) ending exactly at `end`. */
|
|
292
|
+
blockEndingAt(end) {
|
|
293
|
+
return this.#blocks.find((block) => !block.span && isoBlockEnd(block.start, block.length) === end);
|
|
294
|
+
}
|
|
274
295
|
/** The known block or span starting exactly at `start`. */
|
|
275
296
|
blockAt(start) {
|
|
276
297
|
return this.#blocks.find((block) => block.start === start);
|
|
@@ -293,6 +314,9 @@ var IsoBlockLocator = class _IsoBlockLocator {
|
|
|
293
314
|
coversBetween(a, b) {
|
|
294
315
|
if (this.#coverageEnd === void 0) return false;
|
|
295
316
|
if (!serial32Precedes(a, b) || serial32Distance(a, b) <= 1) return true;
|
|
317
|
+
const first = a + 1 >>> 0;
|
|
318
|
+
const count = serial32Distance(a, b) - 1;
|
|
319
|
+
if (this.#holes.some((hole) => isoRangesOverlap(first, count, hole.start, hole.length))) return false;
|
|
296
320
|
return serial32Precedes(b - 1 >>> 0, this.#coverageEnd);
|
|
297
321
|
}
|
|
298
322
|
/**
|
|
@@ -322,6 +346,15 @@ var IsoBlockLocator = class _IsoBlockLocator {
|
|
|
322
346
|
* known block (a different length, or an overlap with another block or a
|
|
323
347
|
* span) fails closed: the repair symbol is dropped and no block changes.
|
|
324
348
|
* A newly stated block retires behind its SS_Start (see the class note).
|
|
349
|
+
* A block so far past `newest` that stating it would retire the position
|
|
350
|
+
* `newest` is refused as `ahead`. When `newest` is a placed block's SS_Start
|
|
351
|
+
* this is slightly conservative (retirement measures that block from its
|
|
352
|
+
* last SS_ID), dropping up to one block-length of repairs past the horizon
|
|
353
|
+
* until a source moves `newest`. Placing it would turn everything
|
|
354
|
+
* between into a repair-less span and leave every real repair behind it
|
|
355
|
+
* `stale`. Sources move `newest` (`hold`, `observe`), so after a real outage
|
|
356
|
+
* the first source back brings the next repair inside the horizon; until one
|
|
357
|
+
* arrives, a stream's repairs alone cannot pass it.
|
|
325
358
|
*/
|
|
326
359
|
placeRepair(start, length) {
|
|
327
360
|
if (!Number.isSafeInteger(length) || length <= 0 || length > this.#kMax) {
|
|
@@ -340,6 +373,22 @@ var IsoBlockLocator = class _IsoBlockLocator {
|
|
|
340
373
|
}
|
|
341
374
|
return { status: "placed", block: known, placed: [] };
|
|
342
375
|
}
|
|
376
|
+
const pending = this.#holes.find((h) => isoBlockContains(h.start, h.length, start));
|
|
377
|
+
if (pending !== void 0) {
|
|
378
|
+
if (!isoBlockContains(pending.start, pending.length, serial32Add(start, length - 1))) {
|
|
379
|
+
return { status: "overlap", reason: `repair block ${start}+${length} runs past pending hole ${pending.start}+${pending.length}` };
|
|
380
|
+
}
|
|
381
|
+
this.#holes.splice(this.#holes.indexOf(pending), 1);
|
|
382
|
+
const before = serial32Distance(pending.start, start);
|
|
383
|
+
const afterStart = isoBlockEnd(start, length);
|
|
384
|
+
const after = pending.length - before - length;
|
|
385
|
+
if (before > 0) this.#holes.push({ start: pending.start, length: before, span: false });
|
|
386
|
+
if (after > 0) this.#holes.push({ start: afterStart, length: after, span: false });
|
|
387
|
+
const block2 = { start, length, span: false };
|
|
388
|
+
const placed2 = this.#claim(block2);
|
|
389
|
+
this.#blocks.push(block2);
|
|
390
|
+
return { status: "placed", block: block2, placed: placed2 };
|
|
391
|
+
}
|
|
343
392
|
for (const block2 of this.#blocks) {
|
|
344
393
|
if (isoBlockContains(block2.start, block2.length, start) || isoBlockContains(start, length, block2.start)) {
|
|
345
394
|
return {
|
|
@@ -348,7 +397,11 @@ var IsoBlockLocator = class _IsoBlockLocator {
|
|
|
348
397
|
};
|
|
349
398
|
}
|
|
350
399
|
}
|
|
400
|
+
if (this.#newest !== void 0 && isoBlocksBehindLowerBound(this.#newest, start, this.#kMax) > this.#retentionBlocks) {
|
|
401
|
+
return { status: "ahead", reason: `repair block ${start}+${length} is past the retention horizon ahead of ${this.#newest}` };
|
|
402
|
+
}
|
|
351
403
|
let span;
|
|
404
|
+
let hole;
|
|
352
405
|
if (this.#coverageEnd === void 0) {
|
|
353
406
|
for (const ssId of this.#held.keys()) {
|
|
354
407
|
if (serial32Precedes(ssId, start)) this.#held.delete(ssId);
|
|
@@ -357,21 +410,51 @@ var IsoBlockLocator = class _IsoBlockLocator {
|
|
|
357
410
|
} else if (serial32Precedes(start, this.#coverageEnd)) {
|
|
358
411
|
return { status: "stale", reason: `repair block ${start}+${length} precedes known coverage` };
|
|
359
412
|
} else if (start !== this.#coverageEnd) {
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
span:
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
413
|
+
const gap = { start: this.#coverageEnd, length: serial32Distance(this.#coverageEnd, start) };
|
|
414
|
+
const lostSsId = this.deferIncompleteGaps ? this.#highestMissing(gap.start, gap.length) : void 0;
|
|
415
|
+
if (lostSsId !== void 0) {
|
|
416
|
+
const holeBlock = { ...gap, span: false };
|
|
417
|
+
this.#holes.push(holeBlock);
|
|
418
|
+
hole = { block: holeBlock, lostSsId };
|
|
419
|
+
} else {
|
|
420
|
+
const spanBlock = { ...gap, span: true };
|
|
421
|
+
span = { block: spanBlock, placed: this.#claim(spanBlock) };
|
|
422
|
+
this.#blocks.push(spanBlock);
|
|
423
|
+
}
|
|
367
424
|
}
|
|
368
425
|
const block = { start, length, span: false };
|
|
369
426
|
const placed = this.#claim(block);
|
|
370
427
|
this.#blocks.push(block);
|
|
371
428
|
this.#coverageEnd = isoBlockEnd(start, length);
|
|
372
429
|
this.retireBehind(start);
|
|
430
|
+
if (hole !== void 0) return { status: "placed", block, placed, hole };
|
|
373
431
|
return span === void 0 ? { status: "placed", block, placed } : { status: "placed", block, placed, span };
|
|
374
432
|
}
|
|
433
|
+
/**
|
|
434
|
+
* Turn every pending hole inside `[start, start + length)` into a
|
|
435
|
+
* repair-less span, claiming its held sources: its range FETCH ended, so
|
|
436
|
+
* nothing more will state its blocks. Returns the spans, in SS_ID order.
|
|
437
|
+
*/
|
|
438
|
+
closeHolesWithin(start, length) {
|
|
439
|
+
const closed = [];
|
|
440
|
+
for (const hole of [...this.#holes]) {
|
|
441
|
+
if (!isoBlockContains(start, length, hole.start)) continue;
|
|
442
|
+
this.#holes.splice(this.#holes.indexOf(hole), 1);
|
|
443
|
+
const spanBlock = { start: hole.start, length: hole.length, span: true };
|
|
444
|
+
closed.push({ block: spanBlock, placed: this.#claim(spanBlock) });
|
|
445
|
+
this.#blocks.push(spanBlock);
|
|
446
|
+
}
|
|
447
|
+
return closed.sort((x, y) => serial32Distance(start, x.block.start) - serial32Distance(start, y.block.start));
|
|
448
|
+
}
|
|
449
|
+
/** The highest SS_ID in the range no source is held for, or undefined when all are. */
|
|
450
|
+
#highestMissing(start, length) {
|
|
451
|
+
const steps = Math.min(length, this.#held.size + 1);
|
|
452
|
+
for (let i = 1; i <= steps; i++) {
|
|
453
|
+
const ssId = serial32Add(start, length - i);
|
|
454
|
+
if (!this.#held.has(ssId)) return ssId;
|
|
455
|
+
}
|
|
456
|
+
return void 0;
|
|
457
|
+
}
|
|
375
458
|
/**
|
|
376
459
|
* Retire every block and span whose last SS_ID, and every held source,
|
|
377
460
|
* lies more than `retentionBlocks` blocks behind `position`, with the shared
|
|
@@ -390,6 +473,11 @@ var IsoBlockLocator = class _IsoBlockLocator {
|
|
|
390
473
|
this.#blocks.splice(i, 1);
|
|
391
474
|
}
|
|
392
475
|
}
|
|
476
|
+
for (let i = this.#holes.length - 1; i >= 0; i--) {
|
|
477
|
+
const hole = this.#holes[i];
|
|
478
|
+
const last = serial32Add(hole.start, hole.length - 1);
|
|
479
|
+
if (isoBlocksBehindLowerBound(last, position, this.#kMax) > horizon) this.#holes.splice(i, 1);
|
|
480
|
+
}
|
|
393
481
|
for (const ssId of [...this.#held.keys()]) {
|
|
394
482
|
if (isoBlocksBehindLowerBound(ssId, position, this.#kMax) > horizon) this.#held.delete(ssId);
|
|
395
483
|
}
|
|
@@ -398,6 +486,7 @@ var IsoBlockLocator = class _IsoBlockLocator {
|
|
|
398
486
|
/** Forget everything (publisher restart, track reset). */
|
|
399
487
|
reset() {
|
|
400
488
|
this.#blocks.length = 0;
|
|
489
|
+
this.#holes.length = 0;
|
|
401
490
|
this.#held.clear();
|
|
402
491
|
this.#coverageEnd = void 0;
|
|
403
492
|
this.#newest = void 0;
|
|
@@ -413,6 +502,9 @@ var IsoBlockLocator = class _IsoBlockLocator {
|
|
|
413
502
|
return placed;
|
|
414
503
|
}
|
|
415
504
|
};
|
|
505
|
+
function isoRangesOverlap(aStart, aLength, bStart, bLength) {
|
|
506
|
+
return serial32Distance(aStart, bStart) < aLength || serial32Distance(bStart, aStart) < bLength;
|
|
507
|
+
}
|
|
416
508
|
|
|
417
509
|
// src/fec-state.ts
|
|
418
510
|
var MIN_INTERLEAVE_DEPTH_MS = 1;
|
|
@@ -762,7 +854,81 @@ var BlockClassifier = class {
|
|
|
762
854
|
}
|
|
763
855
|
};
|
|
764
856
|
|
|
857
|
+
// src/held-layer-admission.ts
|
|
858
|
+
var HORIZON_CAP = 1073741824;
|
|
859
|
+
function heldLayerAnchorHorizon(retentionBlocks, k) {
|
|
860
|
+
return retentionBlocks === void 0 || k <= 0 ? HORIZON_CAP : Math.min(HORIZON_CAP, retentionBlocks * k);
|
|
861
|
+
}
|
|
862
|
+
var HeldLayerAdmission = class {
|
|
863
|
+
#layerNames;
|
|
864
|
+
#states;
|
|
865
|
+
constructor(layers, heldLayers = [0]) {
|
|
866
|
+
const held = new Set(heldLayers);
|
|
867
|
+
this.#layerNames = new Set(layers.map((l) => l.repairTrackName));
|
|
868
|
+
this.#states = layers.filter((l) => held.has(l.layer)).map((l) => ({ layer: l.layer, repairTrackName: l.repairTrackName, total: l.rsIdOffset + l.repairSymbols }));
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Judges one repair packet, after the 4.5 discards and the size check and
|
|
872
|
+
* before it places a block. `repairTrackName` is the subscribed repair
|
|
873
|
+
* track, never inferred from RS_ID; without it only (b) runs. A packet on a
|
|
874
|
+
* repair track the catalog does not list is `'discard'` and anchors nothing.
|
|
875
|
+
* `sourceFrontier` is the newest source SS_ID, if any: a repair more than
|
|
876
|
+
* `horizon` past it is judged without moving the anchored state.
|
|
877
|
+
*
|
|
878
|
+
* @returns undefined to admit, `'discard'`, or the fail-closed reason.
|
|
879
|
+
*/
|
|
880
|
+
admit(repairTrackName, ssStart, rsbLength, horizon, sourceFrontier) {
|
|
881
|
+
if (repairTrackName !== void 0 && !this.#layerNames.has(repairTrackName)) return "discard";
|
|
882
|
+
const farAhead = sourceFrontier !== void 0 && serial32Precedes(sourceFrontier, ssStart) && serial32Distance(sourceFrontier, ssStart) > horizon;
|
|
883
|
+
for (const state of this.#states) {
|
|
884
|
+
let code;
|
|
885
|
+
if (farAhead) {
|
|
886
|
+
if (rsbLength < state.total) {
|
|
887
|
+
if (state.layer > 0 && repairTrackName === state.repairTrackName) code = "below_own_track_total";
|
|
888
|
+
else if (state.anchor !== void 0 || state.settled) code = "below_anchored_total";
|
|
889
|
+
}
|
|
890
|
+
} else {
|
|
891
|
+
if (state.newest === void 0 || serial32Precedes(state.newest, ssStart)) state.newest = ssStart;
|
|
892
|
+
const stale = (s) => serial32Distance(s, state.newest) > horizon;
|
|
893
|
+
if (state.latestBelow !== void 0 && stale(state.latestBelow)) {
|
|
894
|
+
delete state.latestBelow;
|
|
895
|
+
delete state.latestBelowRsb;
|
|
896
|
+
}
|
|
897
|
+
if (state.anchor !== void 0 && stale(state.anchor)) state.settled = true;
|
|
898
|
+
if (rsbLength < state.total) {
|
|
899
|
+
if (state.layer > 0 && repairTrackName === state.repairTrackName) code = "below_own_track_total";
|
|
900
|
+
else if (stale(ssStart)) continue;
|
|
901
|
+
else if (state.settled || state.anchor !== void 0 && !serial32Precedes(ssStart, state.anchor)) code = "below_anchored_total";
|
|
902
|
+
else if (state.latestBelow === void 0 || serial32Precedes(state.latestBelow, ssStart)) {
|
|
903
|
+
state.latestBelow = ssStart;
|
|
904
|
+
state.latestBelowRsb = rsbLength;
|
|
905
|
+
}
|
|
906
|
+
} else if (!state.settled && !stale(ssStart)) {
|
|
907
|
+
if (state.anchor === void 0 || serial32Precedes(ssStart, state.anchor)) state.anchor = ssStart;
|
|
908
|
+
if (state.latestBelow !== void 0 && !serial32Precedes(state.latestBelow, state.anchor)) {
|
|
909
|
+
code = "below_anchored_total";
|
|
910
|
+
ssStart = state.latestBelow;
|
|
911
|
+
rsbLength = state.latestBelowRsb;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
if (code !== void 0) {
|
|
916
|
+
return {
|
|
917
|
+
code,
|
|
918
|
+
layer: state.layer,
|
|
919
|
+
total: state.total,
|
|
920
|
+
rsbLength,
|
|
921
|
+
ssStart,
|
|
922
|
+
...state.anchor === void 0 ? {} : { anchor: state.anchor }
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
return void 0;
|
|
927
|
+
}
|
|
928
|
+
};
|
|
929
|
+
|
|
765
930
|
// src/fec-manager.ts
|
|
931
|
+
var RS_MAX_BLOCK_SYMBOLS = 255;
|
|
766
932
|
var WORKER_ERROR_LOG_CAP = 5;
|
|
767
933
|
var WORKER_ERROR_KIND_CAP = 32;
|
|
768
934
|
var WORKER_ERROR_OVERFLOW_KIND = "other";
|
|
@@ -877,6 +1043,11 @@ var FECManager = class _FECManager {
|
|
|
877
1043
|
// RSB_length per block (C.5.3 Repair FEC Payload ID): how many repair
|
|
878
1044
|
// symbols its repair group carries. Same lifecycle as #blockRepairRsIds.
|
|
879
1045
|
this.#blockRsbLengths = /* @__PURE__ */ new Map();
|
|
1046
|
+
/** fec-01 6.3.9 anchor state per stream key, one entry per held layer. */
|
|
1047
|
+
this.#heldLayerStates = /* @__PURE__ */ new Map();
|
|
1048
|
+
/** Streams whose FEC failed closed at runtime (fec-01 6.3.9). */
|
|
1049
|
+
this.#fecFailClosed = /* @__PURE__ */ new Map();
|
|
1050
|
+
this.#onFecFailClosed = null;
|
|
880
1051
|
// Blocks already recovered — prevents late source symbols from restarting timeouts.
|
|
881
1052
|
// WASM removes blocks after recovery; late symbols create empty blocks returning null,
|
|
882
1053
|
// which would falsely start new timeouts without this guard.
|
|
@@ -997,12 +1168,17 @@ var FECManager = class _FECManager {
|
|
|
997
1168
|
// per stream. Not only throws: the ordinary out-of-range case is detected by
|
|
998
1169
|
// arithmetic and never throws at all.
|
|
999
1170
|
this.#orderedHorizonWarnedFor = /* @__PURE__ */ new Set();
|
|
1000
|
-
// Newest block start (SS_Start)
|
|
1001
|
-
//
|
|
1171
|
+
// Newest block start (SS_Start) any symbol carried per stream and when: the
|
|
1172
|
+
// frontier isoSpanResolution reads.
|
|
1002
1173
|
this.#highestSbn = /* @__PURE__ */ new Map();
|
|
1174
|
+
// The same from source symbols alone: the frontier a source is judged
|
|
1175
|
+
// against for a discontinuity. Repairs ride their own group, which can run
|
|
1176
|
+
// blocks ahead of the media they protect.
|
|
1177
|
+
this.#sourceFrontiers = /* @__PURE__ */ new Map();
|
|
1003
1178
|
// iso-ssbg1-v1 block location per stream (streamKey). A source belongs to a
|
|
1004
1179
|
// block only once a repair symbol stated the block's (SS_Start, SSB_length).
|
|
1005
1180
|
this.#isoLocators = /* @__PURE__ */ new Map();
|
|
1181
|
+
this.#deferIsoGaps = false;
|
|
1006
1182
|
this.#isoRepairRefusedCount = 0;
|
|
1007
1183
|
this.#isoSourceOversizeCount = 0;
|
|
1008
1184
|
// Held sources a locator's capacity cap evicted (IsoBlockLocator.heldCapacity):
|
|
@@ -1017,8 +1193,8 @@ var FECManager = class _FECManager {
|
|
|
1017
1193
|
// rate-limited like the other per-symbol warns here. Cumulative.
|
|
1018
1194
|
this.#isoDecoderUnplacedRetireFailed = 0;
|
|
1019
1195
|
// The latest source symbol per stream that carried its MMTP
|
|
1020
|
-
// packet_sequence_number: the anchor that bounds how
|
|
1021
|
-
// producer can have
|
|
1196
|
+
// packet_sequence_number, by its own SS_ID: the anchor that bounds how far
|
|
1197
|
+
// the producer's SS_IDs can have moved before or after another source symbol.
|
|
1022
1198
|
this.#sourceAnchors = /* @__PURE__ */ new Map();
|
|
1023
1199
|
// Catalog/reset epoch per packetId. Gap decisions carry it for fencing.
|
|
1024
1200
|
this.#packetEpochs = /* @__PURE__ */ new Map();
|
|
@@ -1077,6 +1253,14 @@ var FECManager = class _FECManager {
|
|
|
1077
1253
|
this.onBlockReclassified = null;
|
|
1078
1254
|
/** A video stream's classifier mode was established or changed. */
|
|
1079
1255
|
this.onClassifierMode = null;
|
|
1256
|
+
/**
|
|
1257
|
+
* A repair stated a block past a gap that is missing a source and whose
|
|
1258
|
+
* every repair was lost: a lost SS_ID in an undelimited span
|
|
1259
|
+
* (draft-ramadan-moq-fec §7.5). Set with `setUndelimitedLossHandler`; the
|
|
1260
|
+
* receiver keeps the gap as a pending hole until `closeIsoHoles` is called
|
|
1261
|
+
* for it, which it must be.
|
|
1262
|
+
*/
|
|
1263
|
+
this.#onUndelimitedLoss = null;
|
|
1080
1264
|
/** A block every symbol of which vanished was created by SBN evidence. */
|
|
1081
1265
|
this.onBlockVanished = null;
|
|
1082
1266
|
/** A block reached a terminal state (completed, recovered, or failed). */
|
|
@@ -1118,6 +1302,9 @@ var FECManager = class _FECManager {
|
|
|
1118
1302
|
#ssbLengthConflictCount;
|
|
1119
1303
|
#blockRepairRsIds;
|
|
1120
1304
|
#blockRsbLengths;
|
|
1305
|
+
#heldLayerStates;
|
|
1306
|
+
#fecFailClosed;
|
|
1307
|
+
#onFecFailClosed;
|
|
1121
1308
|
#completedBlocks;
|
|
1122
1309
|
#terminalExpiryMs;
|
|
1123
1310
|
#terminalQueues;
|
|
@@ -1156,7 +1343,9 @@ var FECManager = class _FECManager {
|
|
|
1156
1343
|
#materializedBlocks;
|
|
1157
1344
|
#orderedHorizonWarnedFor;
|
|
1158
1345
|
#highestSbn;
|
|
1346
|
+
#sourceFrontiers;
|
|
1159
1347
|
#isoLocators;
|
|
1348
|
+
#deferIsoGaps;
|
|
1160
1349
|
#isoRepairRefusedCount;
|
|
1161
1350
|
#isoSourceOversizeCount;
|
|
1162
1351
|
#isoHeldEvictedCount;
|
|
@@ -1170,6 +1359,7 @@ var FECManager = class _FECManager {
|
|
|
1170
1359
|
#workerErrorCounts;
|
|
1171
1360
|
#decoderUnavailableEvents;
|
|
1172
1361
|
#repairSymbolSizeMismatchCount;
|
|
1362
|
+
#onUndelimitedLoss;
|
|
1173
1363
|
#encodeTrackName(catalogTrackName) {
|
|
1174
1364
|
let encoded = this.#encodedTrackNames.get(catalogTrackName);
|
|
1175
1365
|
if (encoded === void 0) {
|
|
@@ -1746,8 +1936,8 @@ var FECManager = class _FECManager {
|
|
|
1746
1936
|
// Deliberately one block tighter than deriveFecRetentionBlocks over the same
|
|
1747
1937
|
// inputs (that function's `+ 1`). Different question: the retention horizon
|
|
1748
1938
|
// asks how long the decoder still ACCEPTS symbols for a block, this asks how
|
|
1749
|
-
// many blocks a stream can
|
|
1750
|
-
//
|
|
1939
|
+
// many blocks a stream can jump ahead of its frontier before a source symbol
|
|
1940
|
+
// there is a discontinuity rather than loss (see #noteSbnSeen).
|
|
1751
1941
|
// The extra block of retention is slack for a block still being fed; a block
|
|
1752
1942
|
// nothing has been heard from does not get it. Not the units defect — but it
|
|
1753
1943
|
// is the next place the two can drift, so change both or neither.
|
|
@@ -1757,55 +1947,72 @@ var FECManager = class _FECManager {
|
|
|
1757
1947
|
}
|
|
1758
1948
|
/**
|
|
1759
1949
|
* Record that a symbol for block `sbn` (the block's SS_Start) arrived and
|
|
1760
|
-
* advance the stream's
|
|
1950
|
+
* advance the stream's frontiers, the newest block start seen.
|
|
1761
1951
|
*
|
|
1762
|
-
* A SOURCE symbol
|
|
1763
|
-
*
|
|
1764
|
-
*
|
|
1952
|
+
* A SOURCE symbol is judged against the newest source block alone: repairs
|
|
1953
|
+
* ride their own group, which can run blocks ahead of the media. One whose
|
|
1954
|
+
* block goes back further than the blocks this manager retains, or that
|
|
1955
|
+
* cannot have been sent before the source it lies behind, or that jumps
|
|
1956
|
+
* further than the stream could have produced since its last symbol, is a
|
|
1957
|
+
* source discontinuity, not loss. A repair symbol can only advance the
|
|
1765
1958
|
* frontier: a D-28 fetch legitimately answers for an old block, so it never
|
|
1766
1959
|
* signals a discontinuity.
|
|
1767
1960
|
*
|
|
1768
1961
|
* The producer closes a block at its Dth media-unit boundary OR when K
|
|
1769
1962
|
* source symbols filled it, so one interleave span can start several blocks
|
|
1770
|
-
* (every large keyframe does). What bounds a
|
|
1771
|
-
*
|
|
1772
|
-
*
|
|
1773
|
-
*
|
|
1774
|
-
* packet_sequence_number
|
|
1775
|
-
*
|
|
1776
|
-
*
|
|
1963
|
+
* (every large keyframe does). What bounds a jump is therefore packet
|
|
1964
|
+
* evidence, not a block rate: SS_ID advances by one per FEC source packet
|
|
1965
|
+
* (ISO/IEC 23008-1 C.5.2) and the MMTP packet_sequence_number by one per
|
|
1966
|
+
* packet of the packet_id, so with both source symbols'
|
|
1967
|
+
* packet_sequence_number their SS_IDs (`ssId`, not their block starts,
|
|
1968
|
+
* which a repair-less span can put far behind) can move at most the packets
|
|
1969
|
+
* sent between them, in either direction, plus K of slack for sources lost
|
|
1970
|
+
* before a hop that renumbers packets. Without it, only the D-close rate is
|
|
1971
|
+
* known.
|
|
1777
1972
|
*
|
|
1778
1973
|
* Vanished blocks are not enumerated here: their starts are unknown until a
|
|
1779
1974
|
* repair states them. The SS_IDs between two stated blocks become one
|
|
1780
1975
|
* repair-less span when the later block's repair arrives (placeIsoRepair).
|
|
1781
1976
|
*/
|
|
1782
|
-
#noteSbnSeen(sbn, packetId, catalogTrackName, symbol, packetSequenceNumber) {
|
|
1977
|
+
#noteSbnSeen(sbn, packetId, catalogTrackName, symbol, packetSequenceNumber, ssId = sbn) {
|
|
1783
1978
|
const streamKey = this.#streamKey(packetId, catalogTrackName);
|
|
1784
1979
|
const now = performance.now();
|
|
1785
|
-
const previous = this.#highestSbn.get(streamKey);
|
|
1980
|
+
const previous = (symbol === "source" ? this.#sourceFrontiers : this.#highestSbn).get(streamKey);
|
|
1786
1981
|
const anchor = this.#sourceAnchors.get(streamKey);
|
|
1787
1982
|
const psn = symbol === "source" && packetSequenceNumber !== void 0 && Number.isSafeInteger(packetSequenceNumber) && packetSequenceNumber >= 0 && packetSequenceNumber <= 4294967295 ? packetSequenceNumber : void 0;
|
|
1788
1983
|
const anchorHere = () => {
|
|
1789
|
-
if (psn !== void 0 && (anchor === void 0 || !
|
|
1790
|
-
this.#sourceAnchors.set(streamKey, {
|
|
1984
|
+
if (psn !== void 0 && (anchor === void 0 || !serial32Precedes(ssId, anchor.ssId))) {
|
|
1985
|
+
this.#sourceAnchors.set(streamKey, { ssId, psn, atMs: now });
|
|
1791
1986
|
}
|
|
1792
1987
|
};
|
|
1988
|
+
const advance = () => {
|
|
1989
|
+
const highest = this.#highestSbn.get(streamKey);
|
|
1990
|
+
if (highest === void 0 || this.#blockPrecedes(highest.sbn, sbn)) {
|
|
1991
|
+
this.#highestSbn.set(streamKey, { sbn, atMs: now });
|
|
1992
|
+
}
|
|
1993
|
+
if (symbol === "source") this.#sourceFrontiers.set(streamKey, { sbn, atMs: now });
|
|
1994
|
+
anchorHere();
|
|
1995
|
+
};
|
|
1793
1996
|
const discontinuity = () => {
|
|
1794
1997
|
this.#classifiers.get(streamKey)?.noteSourceDiscontinuity();
|
|
1795
1998
|
this.#highestSbn.set(streamKey, { sbn, atMs: now });
|
|
1999
|
+
this.#sourceFrontiers.set(streamKey, { sbn, atMs: now });
|
|
1796
2000
|
if (psn === void 0) this.#sourceAnchors.delete(streamKey);
|
|
1797
|
-
else this.#sourceAnchors.set(streamKey, {
|
|
2001
|
+
else this.#sourceAnchors.set(streamKey, { ssId, psn, atMs: now });
|
|
1798
2002
|
this.onSourceDiscontinuity?.(packetId, catalogTrackName);
|
|
1799
2003
|
};
|
|
1800
2004
|
if (previous === void 0) {
|
|
1801
|
-
|
|
1802
|
-
anchorHere();
|
|
2005
|
+
advance();
|
|
1803
2006
|
return;
|
|
1804
2007
|
}
|
|
1805
2008
|
const config = this.#trackConfig(packetId);
|
|
1806
2009
|
const window = this.#liveWindowBlocks(config);
|
|
2010
|
+
const sentInOrder = (from, to) => {
|
|
2011
|
+
const sent = to.psn - from.psn >>> 0;
|
|
2012
|
+
return sent <= 2147483647 && serial32Distance(from.ssId, to.ssId) <= sent + config.k;
|
|
2013
|
+
};
|
|
1807
2014
|
if (!this.#blockPrecedes(previous.sbn, sbn)) {
|
|
1808
|
-
if (symbol === "source" && window !== null && this.#blocksBehind(sbn, previous.sbn, packetId) >
|
|
2015
|
+
if (symbol === "source" && window !== null && this.#blockPrecedes(sbn, previous.sbn) && (this.#blocksBehind(sbn, previous.sbn, packetId) > this.#isoRetentionBlocks(packetId) || psn !== void 0 && anchor !== void 0 && serial32Precedes(ssId, anchor.ssId) && psn !== anchor.psn && !sentInOrder({ ssId, psn }, anchor))) {
|
|
1809
2016
|
discontinuity();
|
|
1810
2017
|
return;
|
|
1811
2018
|
}
|
|
@@ -1815,9 +2022,8 @@ var FECManager = class _FECManager {
|
|
|
1815
2022
|
const missing = this.#blocksBehind(previous.sbn, sbn, packetId) - 1;
|
|
1816
2023
|
let plausible = true;
|
|
1817
2024
|
if (window !== null) {
|
|
1818
|
-
if (psn !== void 0 && anchor !== void 0 &&
|
|
1819
|
-
|
|
1820
|
-
plausible = sent <= 2147483647 && serial32Distance(anchor.sbn, sbn) <= sent + config.k;
|
|
2025
|
+
if (psn !== void 0 && anchor !== void 0 && serial32Precedes(anchor.ssId, ssId) && psn !== anchor.psn) {
|
|
2026
|
+
plausible = sentInOrder(anchor, { ssId, psn });
|
|
1821
2027
|
} else {
|
|
1822
2028
|
plausible = missing <= window + Math.ceil((now - previous.atMs) / config.interleaveDepthMs);
|
|
1823
2029
|
}
|
|
@@ -1827,8 +2033,7 @@ var FECManager = class _FECManager {
|
|
|
1827
2033
|
discontinuity();
|
|
1828
2034
|
return;
|
|
1829
2035
|
}
|
|
1830
|
-
|
|
1831
|
-
anchorHere();
|
|
2036
|
+
advance();
|
|
1832
2037
|
}
|
|
1833
2038
|
/*
|
|
1834
2039
|
* Block order for one stream (BLO-35597 iso:5). A block is keyed by its
|
|
@@ -2145,8 +2350,10 @@ var FECManager = class _FECManager {
|
|
|
2145
2350
|
);
|
|
2146
2351
|
}
|
|
2147
2352
|
const hasCatalogTiming = _FECManager.#hasCatalogTiming({ interleaveDepthMs: ownInterleaveDepthMs });
|
|
2353
|
+
const algorithm = config.algorithm ?? previous.algorithm;
|
|
2148
2354
|
const next = {
|
|
2149
2355
|
blockProfile,
|
|
2356
|
+
...algorithm === void 0 ? {} : { algorithm },
|
|
2150
2357
|
k,
|
|
2151
2358
|
symbolSize: config.symbolSize != null && config.symbolSize > 0 ? config.symbolSize : previousTrack?.symbolSize ?? 0,
|
|
2152
2359
|
interleaveDepthMs: ownInterleaveDepthMs,
|
|
@@ -2154,8 +2361,19 @@ var FECManager = class _FECManager {
|
|
|
2154
2361
|
timeoutMs: config.timeoutMs ?? (timingChanged ? 0 : previous.timeoutMs ?? 0),
|
|
2155
2362
|
...(config.trackKind ?? previous.trackKind) === void 0 ? {} : { trackKind: config.trackKind ?? previous.trackKind },
|
|
2156
2363
|
...(config.codec ?? previous.codec) === void 0 ? {} : { codec: config.codec ?? previous.codec },
|
|
2157
|
-
...(config.geometry ?? previous.geometry) === void 0 ? {} : { geometry: config.geometry ?? previous.geometry }
|
|
2364
|
+
...(config.geometry ?? previous.geometry) === void 0 ? {} : { geometry: config.geometry ?? previous.geometry },
|
|
2365
|
+
...(config.repairLayers ?? previous.repairLayers) === void 0 ? {} : { repairLayers: config.repairLayers ?? previous.repairLayers },
|
|
2366
|
+
...(config.heldLayers ?? previous.heldLayers) === void 0 ? {} : { heldLayers: config.heldLayers ?? previous.heldLayers }
|
|
2158
2367
|
};
|
|
2368
|
+
if (
|
|
2369
|
+
// By content: a catalog refresh rebuilds equal arrays, and forgetting
|
|
2370
|
+
// the anchors on one would fail open.
|
|
2371
|
+
JSON.stringify(next.repairLayers) !== JSON.stringify(previous.repairLayers) || JSON.stringify(next.heldLayers) !== JSON.stringify(previous.heldLayers)
|
|
2372
|
+
) {
|
|
2373
|
+
for (const key of [...this.#heldLayerStates.keys()]) {
|
|
2374
|
+
if (this.#belongsToPacket(key, packetId)) this.#heldLayerStates.delete(key);
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2159
2377
|
if (!hasCatalogTiming) {
|
|
2160
2378
|
next.timeoutMs = config.timeoutMs !== void 0 && config.timeoutMs > 0 ? config.timeoutMs : previousTrack !== void 0 && previousTrack.interleaveDepthMs === 0 ? previousTrack.timeoutMs : LOCAL_FEC_TIMEOUT_MS;
|
|
2161
2379
|
} else {
|
|
@@ -2390,6 +2608,8 @@ var FECManager = class _FECManager {
|
|
|
2390
2608
|
resetMap(this.#blockAuthoredLengths);
|
|
2391
2609
|
resetMap(this.#blockRepairRsIds);
|
|
2392
2610
|
resetMap(this.#blockRsbLengths);
|
|
2611
|
+
resetMap(this.#heldLayerStates);
|
|
2612
|
+
resetMap(this.#fecFailClosed);
|
|
2393
2613
|
resetMap(this.#blockPathCounts);
|
|
2394
2614
|
resetMap(this.#blockAnchorsMs);
|
|
2395
2615
|
resetMap(this.#blockCatalogTrackNames);
|
|
@@ -2412,6 +2632,7 @@ var FECManager = class _FECManager {
|
|
|
2412
2632
|
resetSet(this.#materializedBlocks);
|
|
2413
2633
|
resetMap(this.#resolvedBlockClasses);
|
|
2414
2634
|
resetMap(this.#highestSbn);
|
|
2635
|
+
resetMap(this.#sourceFrontiers);
|
|
2415
2636
|
resetMap(this.#isoLocators);
|
|
2416
2637
|
resetMap(this.#sourceAnchors);
|
|
2417
2638
|
this.#classifiers.delete(this.#streamKey(packetId, catalogTrackName));
|
|
@@ -2517,6 +2738,7 @@ var FECManager = class _FECManager {
|
|
|
2517
2738
|
dropMap(this.#orderedPendingBlocks);
|
|
2518
2739
|
dropMap(this.#resolvedBlockClasses);
|
|
2519
2740
|
dropMap(this.#highestSbn);
|
|
2741
|
+
dropMap(this.#sourceFrontiers);
|
|
2520
2742
|
dropMap(this.#isoLocators);
|
|
2521
2743
|
dropMap(this.#sourceAnchors);
|
|
2522
2744
|
dropMap(this.#classifiers);
|
|
@@ -2609,7 +2831,13 @@ var FECManager = class _FECManager {
|
|
|
2609
2831
|
if (isSourceSymbol && esi === 0) {
|
|
2610
2832
|
this.#startupPartialBlocks.delete(blockKey);
|
|
2611
2833
|
this.#startupAlignedPackets.add(streamKey);
|
|
2612
|
-
} else if (
|
|
2834
|
+
} else if (
|
|
2835
|
+
// A ready multicast repair opens a block the join has not seen yet, never
|
|
2836
|
+
// a join partial: its sources were refused, so its repairs alone open a
|
|
2837
|
+
// block that cannot decode and fails at its deadline, once per packet ID
|
|
2838
|
+
// per join (BLO-48308).
|
|
2839
|
+
isStartupPartial || !this.#startupAlignedPackets.has(streamKey) && !isReadyMulticastRepair
|
|
2840
|
+
) {
|
|
2613
2841
|
this.#markStartupPartial(blockKey);
|
|
2614
2842
|
return false;
|
|
2615
2843
|
}
|
|
@@ -2794,6 +3022,18 @@ var FECManager = class _FECManager {
|
|
|
2794
3022
|
blockAnchorAtMs(sbn, packetId, catalogTrackName) {
|
|
2795
3023
|
return this.#blockAnchorsMs.get(this.#blockKey(sbn, packetId, catalogTrackName));
|
|
2796
3024
|
}
|
|
3025
|
+
/**
|
|
3026
|
+
* How long ago (ms) the oldest open block of the stream, one with an FEC
|
|
3027
|
+
* deadline, took its first accepted symbol; undefined with none open.
|
|
3028
|
+
*/
|
|
3029
|
+
oldestOpenBlockAgeMs(packetId, catalogTrackName) {
|
|
3030
|
+
let oldest = Infinity;
|
|
3031
|
+
for (const key of this.#activeBlocks.keys()) {
|
|
3032
|
+
if (!this.#belongsToStream(key, packetId, catalogTrackName)) continue;
|
|
3033
|
+
oldest = Math.min(oldest, this.#blockAnchorsMs.get(key) ?? Infinity);
|
|
3034
|
+
}
|
|
3035
|
+
return oldest === Infinity ? void 0 : performance.now() - oldest;
|
|
3036
|
+
}
|
|
2797
3037
|
/** Absolute fail deadline of a still-open block, or undefined. */
|
|
2798
3038
|
blockDeadlineAtMs(sbn, packetId, catalogTrackName) {
|
|
2799
3039
|
return this.#activeBlockDeadlinesMs.get(this.#blockKey(sbn, packetId, catalogTrackName));
|
|
@@ -2891,6 +3131,7 @@ var FECManager = class _FECManager {
|
|
|
2891
3131
|
let locator = this.#isoLocators.get(streamKey);
|
|
2892
3132
|
if (!locator) {
|
|
2893
3133
|
locator = new IsoBlockLocator(this.#trackConfig(packetId).k, this.#isoRetentionBlocks(packetId));
|
|
3134
|
+
locator.deferIncompleteGaps = this.#deferIsoGaps;
|
|
2894
3135
|
this.#isoLocators.set(streamKey, locator);
|
|
2895
3136
|
}
|
|
2896
3137
|
return locator;
|
|
@@ -2934,6 +3175,10 @@ var FECManager = class _FECManager {
|
|
|
2934
3175
|
}
|
|
2935
3176
|
return blocks;
|
|
2936
3177
|
}
|
|
3178
|
+
/** The iso-ssbg1-v1 locator horizon of a configured packetId, in blocks (#isoRetentionBlocks). */
|
|
3179
|
+
isoRetentionBlocksForPacket(packetId) {
|
|
3180
|
+
return this.#hasBlockProfile(packetId) ? this.#isoRetentionBlocks(packetId) : void 0;
|
|
3181
|
+
}
|
|
2937
3182
|
/** Whether an iso-ssbg1-v1 protected packet fits one ssbg_mode1 symbol (len + 2 <= T). */
|
|
2938
3183
|
isoSourceFits(packetId, packetLength) {
|
|
2939
3184
|
const symbolSize = this.#trackConfigs.get(packetId)?.symbolSize;
|
|
@@ -2983,15 +3228,61 @@ var FECManager = class _FECManager {
|
|
|
2983
3228
|
}
|
|
2984
3229
|
return placement;
|
|
2985
3230
|
}
|
|
2986
|
-
if (placement.span !== void 0)
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
3231
|
+
if (placement.span !== void 0) this.#openIsoSpan(placement.span, packetId, catalogTrackName);
|
|
3232
|
+
if (placement.hole !== void 0) {
|
|
3233
|
+
const locator = this.#isoLocatorFor(packetId, catalogTrackName);
|
|
3234
|
+
const hole = placement.hole.block;
|
|
3235
|
+
const previous = locator.blockEndingAt(hole.start);
|
|
3236
|
+
const loss = {
|
|
3237
|
+
packetId,
|
|
3238
|
+
catalogTrackName,
|
|
3239
|
+
holeStart: hole.start,
|
|
3240
|
+
holeLength: hole.length,
|
|
3241
|
+
lostSsId: placement.hole.lostSsId,
|
|
3242
|
+
kMax: this.#trackConfig(packetId).k,
|
|
3243
|
+
...previous === void 0 ? {} : { previousBlockStart: previous.start }
|
|
3244
|
+
};
|
|
3245
|
+
this.#onUndelimitedLoss(loss);
|
|
2992
3246
|
}
|
|
2993
3247
|
return placement;
|
|
2994
3248
|
}
|
|
3249
|
+
/**
|
|
3250
|
+
* Keep an iso-ssbg1-v1 gap missing a source as a pending hole, reported to
|
|
3251
|
+
* `handler`, instead of a repair-less span; null restores spans. Set by the
|
|
3252
|
+
* range repair scheduler; applies to every stream from its next gap. The
|
|
3253
|
+
* handler and the deferral are one setting, so no hole is ever created with
|
|
3254
|
+
* nobody to close it.
|
|
3255
|
+
*/
|
|
3256
|
+
setUndelimitedLossHandler(handler) {
|
|
3257
|
+
this.#onUndelimitedLoss = handler;
|
|
3258
|
+
this.#deferIsoGaps = handler !== null;
|
|
3259
|
+
for (const locator of this.#isoLocators.values()) locator.deferIncompleteGaps = this.#deferIsoGaps;
|
|
3260
|
+
}
|
|
3261
|
+
/**
|
|
3262
|
+
* The range repair for a hole ended: every hole still pending inside
|
|
3263
|
+
* `[start, start + length)` becomes a repair-less span. Returns those spans
|
|
3264
|
+
* with the held sources they placed, for the caller to feed (MmtpRouter).
|
|
3265
|
+
*/
|
|
3266
|
+
closeIsoHoles(packetId, catalogTrackName, start, length) {
|
|
3267
|
+
const locator = this.#isoLocators.get(this.#streamKey(packetId, catalogTrackName));
|
|
3268
|
+
if (locator === void 0) return [];
|
|
3269
|
+
const spans = locator.closeHolesWithin(start, length);
|
|
3270
|
+
for (const span of spans) this.#openIsoSpan(span, packetId, catalogTrackName);
|
|
3271
|
+
return spans;
|
|
3272
|
+
}
|
|
3273
|
+
/**
|
|
3274
|
+
* A repair-less span has no repair to state its length, so it is known
|
|
3275
|
+
* here: its sources make it clean exactly when all of them arrived. A
|
|
3276
|
+
* stated block learns its SSB_length from its own repair symbol, fed after
|
|
3277
|
+
* its placed sources exactly as on the wire (feedRepairSymbol). A span every
|
|
3278
|
+
* SS_ID of which vanished resolves through its deadline like any vanished
|
|
3279
|
+
* block.
|
|
3280
|
+
*/
|
|
3281
|
+
#openIsoSpan(span, packetId, catalogTrackName) {
|
|
3282
|
+
const key = this.#blockKey(span.block.start, packetId, catalogTrackName);
|
|
3283
|
+
if (!this.#blockAuthoredLengths.has(key)) this.#blockAuthoredLengths.set(key, span.block.length);
|
|
3284
|
+
if (span.placed.length === 0) this.#materializeBlock(span.block.start, packetId, catalogTrackName, true);
|
|
3285
|
+
}
|
|
2995
3286
|
/**
|
|
2996
3287
|
* Resolution of the SS_IDs strictly between two released frames' SS_IDs on
|
|
2997
3288
|
* an iso-ssbg1-v1 stream, for in-order frame release: null while a block
|
|
@@ -3508,6 +3799,112 @@ var FECManager = class _FECManager {
|
|
|
3508
3799
|
}
|
|
3509
3800
|
return recovered;
|
|
3510
3801
|
}
|
|
3802
|
+
/**
|
|
3803
|
+
* fec-01 4.5: a reed-solomon repair packet whose SSB_length + RSB_length
|
|
3804
|
+
* exceeds 255, or whose RS_ID is not below RSB_length, is discarded with the
|
|
3805
|
+
* block state unchanged. The router calls this before the repair places a
|
|
3806
|
+
* block or takes any other part in block bookkeeping. A RaptorQ track admits
|
|
3807
|
+
* every header that parsed (its RS_ID < RSB_length check is in the parser).
|
|
3808
|
+
*/
|
|
3809
|
+
admitRepairBlockLength(packetId, ssbLength, rsbLength, rsId) {
|
|
3810
|
+
if (rsId >= rsbLength) return false;
|
|
3811
|
+
if (this.#trackConfigs.get(packetId)?.algorithm !== "reed-solomon") return true;
|
|
3812
|
+
return ssbLength + rsbLength <= RS_MAX_BLOCK_SYMBOLS;
|
|
3813
|
+
}
|
|
3814
|
+
/**
|
|
3815
|
+
* Whether a repair symbol of `byteLength` bytes is a valid member of a
|
|
3816
|
+
* `packetId` block: every repair symbol is exactly the track's T. A symbol of
|
|
3817
|
+
* any other size is counted on `repairSymbolSizeMismatches`, warned (rate
|
|
3818
|
+
* limited) and refused. The router calls this before the symbol takes any
|
|
3819
|
+
* other part in block state (placement, first-arrival dedup, completed-block
|
|
3820
|
+
* accounting), so a malformed repair is counted whatever its arrival order:
|
|
3821
|
+
* judged after dedup, one landing on an already-complete block, or behind a
|
|
3822
|
+
* valid copy from the other transport, was swallowed as a duplicate and never
|
|
3823
|
+
* counted (BLO-48306). A packetId with no configured block profile admits
|
|
3824
|
+
* nothing here; its repair is dropped upstream as unreadable.
|
|
3825
|
+
*/
|
|
3826
|
+
admitRepairSymbolSize(packetId, ssStart, ssbLength, rsId, byteLength) {
|
|
3827
|
+
if (!this.#hasBlockProfile(packetId)) return false;
|
|
3828
|
+
const symbolSize = this.#trackConfig(packetId).symbolSize;
|
|
3829
|
+
if (symbolSize > 0 && byteLength !== symbolSize) {
|
|
3830
|
+
this.#repairSymbolSizeMismatchCount++;
|
|
3831
|
+
if (this.#repairSymbolSizeMismatchCount <= 5 || this.#repairSymbolSizeMismatchCount % 100 === 0) {
|
|
3832
|
+
console.warn(
|
|
3833
|
+
`[FECManager] Dropping repair symbol with invalid size: got ${byteLength}B, expected ${symbolSize}B (packetId=${packetId}, ssStart=${ssStart}, ssbLength=${ssbLength}, rsId=${rsId})`
|
|
3834
|
+
);
|
|
3835
|
+
}
|
|
3836
|
+
return false;
|
|
3837
|
+
}
|
|
3838
|
+
return true;
|
|
3839
|
+
}
|
|
3840
|
+
/**
|
|
3841
|
+
* fec-01 6.3.9 receiver check, run on a repair packet after the 4.5 discard
|
|
3842
|
+
* and the size check, before it places a block. For each held layer i with
|
|
3843
|
+
* total B_i = O_i + P_i: the anchor is the earliest block, in SS_Start
|
|
3844
|
+
* serial order, whose repair carried RSB_length >= B_i. The source track
|
|
3845
|
+
* fails closed on (a) a packet on layer i's own repair track (i > 0) below
|
|
3846
|
+
* B_i, or (b) any packet of the instance at or after the anchor below B_i.
|
|
3847
|
+
* Blocks before the anchor (pre-append) stay valid at the previous total. A
|
|
3848
|
+
* packet on a repair track the catalog does not list is discarded and
|
|
3849
|
+
* anchors nothing. `repairTrackName` is the subscribed repair track, never
|
|
3850
|
+
* inferred from RS_ID; without it only (b) runs. Returns false when the
|
|
3851
|
+
* repair must be dropped, including every repair once the track failed.
|
|
3852
|
+
*/
|
|
3853
|
+
admitRepairLayerTotal(packetId, catalogTrackName, repairTrackName, ssStart, rsbLength) {
|
|
3854
|
+
const streamKey = this.#streamKey(packetId, catalogTrackName);
|
|
3855
|
+
if (this.#fecFailClosed.has(streamKey)) return false;
|
|
3856
|
+
const config = this.#trackConfigs.get(packetId);
|
|
3857
|
+
const layers = config?.repairLayers;
|
|
3858
|
+
if (layers === void 0 || layers.length === 0) return true;
|
|
3859
|
+
let admission = this.#heldLayerStates.get(streamKey);
|
|
3860
|
+
if (admission === void 0) {
|
|
3861
|
+
admission = new HeldLayerAdmission(layers, config.heldLayers);
|
|
3862
|
+
this.#heldLayerStates.set(streamKey, admission);
|
|
3863
|
+
}
|
|
3864
|
+
const verdict = admission.admit(
|
|
3865
|
+
repairTrackName,
|
|
3866
|
+
ssStart,
|
|
3867
|
+
rsbLength,
|
|
3868
|
+
this.#layerAnchorHorizon(packetId),
|
|
3869
|
+
this.#sourceFrontiers.get(streamKey)?.sbn
|
|
3870
|
+
);
|
|
3871
|
+
if (verdict === "discard") return false;
|
|
3872
|
+
if (verdict !== void 0) {
|
|
3873
|
+
this.#fecFailClosed.set(streamKey, verdict);
|
|
3874
|
+
this.#onFecFailClosed?.({ ...verdict, packetId, catalogTrackName });
|
|
3875
|
+
console.warn(
|
|
3876
|
+
`[FECManager] FEC failed closed (fec-01 6.3.9) packetId=${packetId} track=${catalogTrackName ?? "-"}: ${JSON.stringify(verdict)}`
|
|
3877
|
+
);
|
|
3878
|
+
return false;
|
|
3879
|
+
}
|
|
3880
|
+
return true;
|
|
3881
|
+
}
|
|
3882
|
+
/**
|
|
3883
|
+
* How far (in SS_Start symbols) behind the newest block a 6.3.9 anchor or
|
|
3884
|
+
* below-total block can still matter: the iso locator's retention in blocks
|
|
3885
|
+
* times K, capped at 2^30 so compared serials stay inside one half-window.
|
|
3886
|
+
*/
|
|
3887
|
+
#layerAnchorHorizon(packetId) {
|
|
3888
|
+
let blocks;
|
|
3889
|
+
try {
|
|
3890
|
+
blocks = this.isoRetentionBlocksForPacket(packetId);
|
|
3891
|
+
} catch {
|
|
3892
|
+
blocks = void 0;
|
|
3893
|
+
}
|
|
3894
|
+
return heldLayerAnchorHorizon(blocks, this.#trackConfigs.get(packetId)?.k ?? 0);
|
|
3895
|
+
}
|
|
3896
|
+
/**
|
|
3897
|
+
* Report each stream whose FEC fails closed at runtime (fec-01 6.3.9), once,
|
|
3898
|
+
* when it does; null stops reporting. The player wiring forwards it to
|
|
3899
|
+
* CmcdProducer.updateFecFailClosed.
|
|
3900
|
+
*/
|
|
3901
|
+
setFecFailClosedHandler(handler) {
|
|
3902
|
+
this.#onFecFailClosed = handler;
|
|
3903
|
+
}
|
|
3904
|
+
/** The runtime fail-closed reason of a stream's FEC (fec-01 6.3.9), if any. */
|
|
3905
|
+
fecFailClosedReason(packetId, catalogTrackName) {
|
|
3906
|
+
return this.#fecFailClosed.get(this.#streamKey(packetId, catalogTrackName));
|
|
3907
|
+
}
|
|
3511
3908
|
/**
|
|
3512
3909
|
* Feed a repair symbol to the WASM FEC decoder.
|
|
3513
3910
|
*
|
|
@@ -3519,16 +3916,7 @@ var FECManager = class _FECManager {
|
|
|
3519
3916
|
this.#fecStats.repairPackets++;
|
|
3520
3917
|
this.#statsForPacket(packetId).repairPackets++;
|
|
3521
3918
|
if (!this.#hasBlockProfile(packetId)) return null;
|
|
3522
|
-
|
|
3523
|
-
if (symbolSize > 0 && repairData.byteLength !== symbolSize) {
|
|
3524
|
-
this.#repairSymbolSizeMismatchCount++;
|
|
3525
|
-
if (this.#repairSymbolSizeMismatchCount <= 5 || this.#repairSymbolSizeMismatchCount % 100 === 0) {
|
|
3526
|
-
console.warn(
|
|
3527
|
-
`[FECManager] Dropping repair symbol with invalid size: got ${repairData.byteLength}B, expected ${symbolSize}B (packetId=${packetId}, ssStart=${ssStart}, ssbLength=${ssbLength}, rsId=${rsId})`
|
|
3528
|
-
);
|
|
3529
|
-
}
|
|
3530
|
-
return null;
|
|
3531
|
-
}
|
|
3919
|
+
if (!this.admitRepairSymbolSize(packetId, ssStart, ssbLength, rsId, repairData.byteLength)) return null;
|
|
3532
3920
|
const fecData = repairData;
|
|
3533
3921
|
const k = this.#trackConfig(packetId).k;
|
|
3534
3922
|
const block = this.#isoLocatorFor(packetId, catalogTrackName).blockAt(ssStart);
|
|
@@ -3681,7 +4069,14 @@ var FECManager = class _FECManager {
|
|
|
3681
4069
|
const key = this.#blockKey(sbn, packetId, catalogTrackName);
|
|
3682
4070
|
const k = trackConfig.k;
|
|
3683
4071
|
if (this.#completedBlocks.has(key)) return;
|
|
3684
|
-
this.#noteSbnSeen(
|
|
4072
|
+
this.#noteSbnSeen(
|
|
4073
|
+
sbn,
|
|
4074
|
+
packetId,
|
|
4075
|
+
catalogTrackName,
|
|
4076
|
+
"source",
|
|
4077
|
+
evidence.packetSequenceNumber,
|
|
4078
|
+
Number.isInteger(esi) ? sbn + esi >>> 0 : sbn
|
|
4079
|
+
);
|
|
3685
4080
|
const authoredLength = this.#blockAuthoredLengths.get(key) ?? k;
|
|
3686
4081
|
if (Number.isInteger(esi) && esi >= authoredLength) {
|
|
3687
4082
|
this.#failBlock(sbn, packetId, catalogTrackName);
|
|
@@ -3908,6 +4303,8 @@ var FECManager = class _FECManager {
|
|
|
3908
4303
|
this.#blockAuthoredLengths.clear();
|
|
3909
4304
|
this.#blockRepairRsIds.clear();
|
|
3910
4305
|
this.#blockRsbLengths.clear();
|
|
4306
|
+
this.#heldLayerStates.clear();
|
|
4307
|
+
this.#fecFailClosed.clear();
|
|
3911
4308
|
this.#completedBlocks.clear();
|
|
3912
4309
|
this.#cleanlyCompletedBlocks.clear();
|
|
3913
4310
|
this.#repairRequestedBlocks.clear();
|
|
@@ -3932,6 +4329,7 @@ var FECManager = class _FECManager {
|
|
|
3932
4329
|
this.#repairedBlocks.clear();
|
|
3933
4330
|
this.#materializedBlocks.clear();
|
|
3934
4331
|
this.#highestSbn.clear();
|
|
4332
|
+
this.#sourceFrontiers.clear();
|
|
3935
4333
|
this.#isoLocators.clear();
|
|
3936
4334
|
this.#sourceAnchors.clear();
|
|
3937
4335
|
this.#trackConfigs.clear();
|