@blockcast/mmt-container 2.2.0-main.4a79a288e69e → 2.2.0-main.4ccba0f2f32a
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/dist/browser-runtime.js +1119 -165
- package/dist/browser-runtime.js.map +3 -3
- package/dist/delta-fallback-config.js.map +1 -1
- package/dist/fec-manager.d.ts +67 -11
- package/dist/fec-manager.d.ts.map +1 -1
- package/dist/fec-manager.js +377 -54
- package/dist/fec-manager.js.map +2 -2
- package/dist/fec-worker-setup.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +2 -2
- package/dist/iso-block-locator.d.ts +48 -13
- package/dist/iso-block-locator.d.ts.map +1 -1
- package/dist/iso-block-locator.js +97 -25
- package/dist/iso-block-locator.js.map +2 -2
- package/dist/media-router.js.map +1 -1
- package/dist/mmtp-container-parser.d.ts +64 -8
- package/dist/mmtp-container-parser.d.ts.map +1 -1
- package/dist/mmtp-container-parser.js +159 -21
- package/dist/mmtp-container-parser.js.map +2 -2
- package/dist/mmtp-container-parser.no-modules.js +158 -23
- package/dist/mmtp-container-parser.no-modules.js.map +2 -2
- package/dist/mmtp-decode-pipeline.js +158 -21
- package/dist/mmtp-decode-pipeline.js.map +2 -2
- package/dist/mmtp-router.d.ts +31 -8
- package/dist/mmtp-router.d.ts.map +1 -1
- package/dist/mmtp-router.js +481 -68
- package/dist/mmtp-router.js.map +2 -2
- package/dist/multicast-manager.d.ts +26 -3
- package/dist/multicast-manager.d.ts.map +1 -1
- package/dist/multicast-manager.js +940 -139
- package/dist/multicast-manager.js.map +2 -2
- package/dist/multicast-transport.js +2 -2
- package/dist/multicast-transport.js.map +2 -2
- package/dist/no-modules.js +158 -21
- package/dist/no-modules.js.map +2 -2
- package/dist/repair-fetch.d.ts +36 -8
- package/dist/repair-fetch.d.ts.map +1 -1
- package/dist/repair-fetch.js +285 -26
- package/dist/repair-fetch.js.map +3 -3
- package/dist/track-session.d.ts.map +1 -1
- package/dist/track-session.js +1 -0
- package/dist/track-session.js.map +2 -2
- package/dist/wasm-mmtp-container-parser.js +158 -21
- package/dist/wasm-mmtp-container-parser.js.map +2 -2
- package/package.json +5 -5
- package/src/fec-manager.ts +407 -28
- package/src/index.ts +3 -0
- package/src/iso-block-locator.ts +133 -31
- package/src/mmtp-container-parser.ts +273 -26
- package/src/mmtp-router.ts +541 -55
- package/src/multicast-manager.ts +118 -14
- package/src/repair-fetch.ts +363 -49
- package/src/track-session.ts +3 -0
package/dist/no-modules.js
CHANGED
|
@@ -5914,6 +5914,9 @@ function authoredGap(before, after) {
|
|
|
5914
5914
|
function ssIdAfter(a, b) {
|
|
5915
5915
|
return (a - b | 0) > 0;
|
|
5916
5916
|
}
|
|
5917
|
+
function holdsRebuilt(stream) {
|
|
5918
|
+
return stream.buf.some(({ meta }) => meta.fecSbnFirst !== void 0);
|
|
5919
|
+
}
|
|
5917
5920
|
var FecReleaseSequencer = class {
|
|
5918
5921
|
#streams = /* @__PURE__ */ new Map();
|
|
5919
5922
|
#gate;
|
|
@@ -5976,6 +5979,7 @@ var FecReleaseSequencer = class {
|
|
|
5976
5979
|
stream.lastSbn = void 0;
|
|
5977
5980
|
stream.discontinuity = false;
|
|
5978
5981
|
stream.rapSsId = void 0;
|
|
5982
|
+
stream.sourced = false;
|
|
5979
5983
|
}
|
|
5980
5984
|
if (stream.last !== null && compareFrameOrder(frame, stream.last) <= 0) {
|
|
5981
5985
|
this.#recordStat("droppedStale");
|
|
@@ -6002,6 +6006,7 @@ var FecReleaseSequencer = class {
|
|
|
6002
6006
|
if (compareFrameOrder(stream.buf[mid], frame) < 0) lo = mid + 1;
|
|
6003
6007
|
else hi = mid;
|
|
6004
6008
|
}
|
|
6009
|
+
if (stream.buf[lo]?.passed === true) frame.passed = true;
|
|
6005
6010
|
stream.buf.splice(lo, 0, frame);
|
|
6006
6011
|
this.#drainUnlessDeferred(stream);
|
|
6007
6012
|
}
|
|
@@ -6037,6 +6042,41 @@ var FecReleaseSequencer = class {
|
|
|
6037
6042
|
}
|
|
6038
6043
|
return false;
|
|
6039
6044
|
}
|
|
6045
|
+
/**
|
|
6046
|
+
* These streams' sink is being replaced by one that has seen no source
|
|
6047
|
+
* frame yet. First, from a stream that holds a frame the overlay rebuilt,
|
|
6048
|
+
* release to the sink being replaced the frames the unanchored path had
|
|
6049
|
+
* already released to it (#cursorPassed): there they waited in its queue,
|
|
6050
|
+
* which its replacement flushes. A stream that holds none is not drained:
|
|
6051
|
+
* it holds nothing the anchor kept back, and a drain would still force out
|
|
6052
|
+
* a frame held past the hold limit, which before the anchor waited for the
|
|
6053
|
+
* next push. Then treat the streams as unsourced until a source frame is
|
|
6054
|
+
* released.
|
|
6055
|
+
*/
|
|
6056
|
+
unsource(packetId, catalogTrackName) {
|
|
6057
|
+
for (const stream of this.#streams.values()) {
|
|
6058
|
+
if (stream.packetId === packetId && (catalogTrackName === void 0 || stream.catalogTrackName === catalogTrackName)) {
|
|
6059
|
+
if (stream.draining === 0 && holdsRebuilt(stream)) {
|
|
6060
|
+
if (this.#deferDepth > 0) this.#deferredStreams.add(stream);
|
|
6061
|
+
else this.#drain(stream, true);
|
|
6062
|
+
}
|
|
6063
|
+
stream.sourced = false;
|
|
6064
|
+
}
|
|
6065
|
+
}
|
|
6066
|
+
}
|
|
6067
|
+
/**
|
|
6068
|
+
* Whether a stream of `packetId` holds a frame the keyframe overlay rebuilt
|
|
6069
|
+
* (FrameMeta.fecSbnFirst). Without `catalogTrackName`, every stream of the
|
|
6070
|
+
* packetId.
|
|
6071
|
+
*/
|
|
6072
|
+
holdsRebuilt(packetId, catalogTrackName) {
|
|
6073
|
+
for (const stream of this.#streams.values()) {
|
|
6074
|
+
if (stream.packetId !== packetId) continue;
|
|
6075
|
+
if (catalogTrackName !== void 0 && stream.catalogTrackName !== catalogTrackName) continue;
|
|
6076
|
+
if (holdsRebuilt(stream)) return true;
|
|
6077
|
+
}
|
|
6078
|
+
return false;
|
|
6079
|
+
}
|
|
6040
6080
|
/** Re-evaluate held gaps after FEC state changed. */
|
|
6041
6081
|
poke(streamKey) {
|
|
6042
6082
|
if (streamKey !== void 0) {
|
|
@@ -6128,16 +6168,32 @@ var FecReleaseSequencer = class {
|
|
|
6128
6168
|
last: null,
|
|
6129
6169
|
lastSbn: void 0,
|
|
6130
6170
|
discontinuity: false,
|
|
6131
|
-
rapSsId: void 0
|
|
6171
|
+
rapSsId: void 0,
|
|
6172
|
+
sourced: false,
|
|
6173
|
+
draining: 0
|
|
6132
6174
|
};
|
|
6133
6175
|
this.#streams.set(streamKey, stream);
|
|
6134
6176
|
}
|
|
6135
6177
|
return stream;
|
|
6136
6178
|
}
|
|
6137
|
-
#
|
|
6179
|
+
/** `asUnanchored`: release overlay-rebuilt frames when unanchored did (#cursorPassed). */
|
|
6180
|
+
#drain(stream, asUnanchored = false) {
|
|
6181
|
+
stream.draining++;
|
|
6182
|
+
try {
|
|
6183
|
+
this.#drainLoop(stream, asUnanchored);
|
|
6184
|
+
} finally {
|
|
6185
|
+
stream.draining--;
|
|
6186
|
+
}
|
|
6187
|
+
}
|
|
6188
|
+
#drainLoop(stream, asUnanchored) {
|
|
6138
6189
|
while (stream.buf.length > 0 && stream.last !== null) {
|
|
6139
6190
|
const head = stream.buf[0];
|
|
6140
6191
|
const last = stream.last;
|
|
6192
|
+
if (compareFrameOrder(head, last) <= 0) {
|
|
6193
|
+
stream.buf.shift();
|
|
6194
|
+
this.#release(stream, head, void 0);
|
|
6195
|
+
continue;
|
|
6196
|
+
}
|
|
6141
6197
|
if (stream.discontinuity) {
|
|
6142
6198
|
stream.discontinuity = false;
|
|
6143
6199
|
stream.buf.shift();
|
|
@@ -6151,9 +6207,10 @@ var FecReleaseSequencer = class {
|
|
|
6151
6207
|
}
|
|
6152
6208
|
const headSbn = head.meta.fecSbn;
|
|
6153
6209
|
const from = stream.lastSbn ?? headSbn;
|
|
6154
|
-
const to = headSbn ?? stream.lastSbn;
|
|
6210
|
+
const to = head.meta.fecSbnFirst ?? headSbn ?? stream.lastSbn;
|
|
6155
6211
|
let lost = [];
|
|
6156
6212
|
const unanchored = from === void 0 && to === void 0;
|
|
6213
|
+
let unresolved = false;
|
|
6157
6214
|
if (from !== void 0 && to !== void 0) {
|
|
6158
6215
|
const resolved = this.#gate.resolvedLoss(
|
|
6159
6216
|
stream.packetId,
|
|
@@ -6162,7 +6219,8 @@ var FecReleaseSequencer = class {
|
|
|
6162
6219
|
Math.max(from, to),
|
|
6163
6220
|
from
|
|
6164
6221
|
);
|
|
6165
|
-
|
|
6222
|
+
unresolved = resolved === null;
|
|
6223
|
+
if (unresolved && !this.#cursorPassed(stream, asUnanchored)) {
|
|
6166
6224
|
const heldMs = performance.now() - head.arrivedAtMs;
|
|
6167
6225
|
if (heldMs <= this.#gate.holdLimitMs(stream.packetId, stream.catalogTrackName)) return;
|
|
6168
6226
|
this.#recordStat("forcedWindowFlushes");
|
|
@@ -6170,22 +6228,56 @@ var FecReleaseSequencer = class {
|
|
|
6170
6228
|
this.#release(stream, head, this.#gate.decide(last, head, [], true));
|
|
6171
6229
|
continue;
|
|
6172
6230
|
}
|
|
6173
|
-
lost = resolved;
|
|
6231
|
+
lost = resolved ?? [];
|
|
6174
6232
|
}
|
|
6175
6233
|
stream.buf.shift();
|
|
6176
6234
|
this.#release(
|
|
6177
6235
|
stream,
|
|
6178
6236
|
head,
|
|
6179
|
-
lost.length > 0 || unanchored || authoredGap(last.meta, head.meta) ? this.#gate.decide(last, head, lost, false) : void 0
|
|
6237
|
+
lost.length > 0 || unanchored || unresolved || authoredGap(last.meta, head.meta) ? this.#gate.decide(last, head, lost, false) : void 0
|
|
6180
6238
|
);
|
|
6181
6239
|
}
|
|
6182
6240
|
}
|
|
6241
|
+
/**
|
|
6242
|
+
* An overlay-rebuilt frame (fecSbnFirst) waits no longer than the BLO-53342
|
|
6243
|
+
* source cursor holds it unanchored, and neither does a later frame behind
|
|
6244
|
+
* it. Unanchored, a frame that waits on no block (fecSbnFirst set, or no
|
|
6245
|
+
* fecSbn) left the gate once every frame ahead of it had: mark it `passed`,
|
|
6246
|
+
* like each frame that arrived in front of it since (stale there). The head
|
|
6247
|
+
* then goes, decided as it would be unanchored, once a frame the base path
|
|
6248
|
+
* delivered (a source frame, or one base FEC recovered) is buffered after a
|
|
6249
|
+
* marked one: the base path has passed that one, so a frame still missing
|
|
6250
|
+
* before it can only come from a repair. It also goes while no source frame
|
|
6251
|
+
* has been released, when the direct path shows a recovered frame at once.
|
|
6252
|
+
* And it goes at once while a staged switch decides on when frames arrive
|
|
6253
|
+
* (FecReleaseGate.releaseUnanchored), and when unsource releases into a
|
|
6254
|
+
* sink being replaced: unanchored, it had already reached the sink.
|
|
6255
|
+
* The scan also writes: the `passed` marks it sets stay on the frames,
|
|
6256
|
+
* and push marks a frame it inserts in front of a marked one from them.
|
|
6257
|
+
*/
|
|
6258
|
+
#cursorPassed(stream, asUnanchored) {
|
|
6259
|
+
let at = -1;
|
|
6260
|
+
for (let i = 0; i < stream.buf.length; i++) {
|
|
6261
|
+
const frame = stream.buf[i];
|
|
6262
|
+
if (frame.meta.fecSbnFirst !== void 0 || frame.meta.fecSbn === void 0) {
|
|
6263
|
+
frame.passed = true;
|
|
6264
|
+
if (at < 0) at = i;
|
|
6265
|
+
} else if (frame.passed !== true) break;
|
|
6266
|
+
}
|
|
6267
|
+
if (at < 0) return false;
|
|
6268
|
+
return asUnanchored || !stream.sourced || this.#gate.releaseUnanchored?.(stream.packetId, stream.catalogTrackName) === true || stream.buf.some(({ meta }, i) => i > at && meta.fecSbnFirst === void 0 && (meta.recovered !== true || meta.fecSbn !== void 0));
|
|
6269
|
+
}
|
|
6183
6270
|
#release(stream, frame, decision) {
|
|
6271
|
+
const stale = stream.last !== null && compareFrameOrder(frame, stream.last) <= 0;
|
|
6272
|
+
if (stale) this.#recordStat("droppedStale");
|
|
6184
6273
|
if (decision) frame.meta.gapBefore = decision;
|
|
6185
6274
|
stream.last = frame;
|
|
6186
|
-
if (frame.meta.fecSbn !== void 0
|
|
6275
|
+
if (frame.meta.fecSbn !== void 0 && (frame.meta.fecSbnFirst === void 0 || stream.lastSbn !== void 0)) {
|
|
6276
|
+
stream.lastSbn = frame.meta.fecSbn;
|
|
6277
|
+
}
|
|
6278
|
+
if (frame.meta.recovered !== true) stream.sourced = true;
|
|
6187
6279
|
this.#gate.onReleased?.(frame.data, frame.meta);
|
|
6188
|
-
this.#emit(frame.data, frame.meta);
|
|
6280
|
+
if (!stale) this.#emit(frame.data, frame.meta);
|
|
6189
6281
|
}
|
|
6190
6282
|
};
|
|
6191
6283
|
var FMPU_BOX_TYPES = /* @__PURE__ */ new Set(["ftyp", "moov", "moof"]);
|
|
@@ -6226,6 +6318,12 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
6226
6318
|
this.#reclaimedTimingSamples = 0;
|
|
6227
6319
|
this.#evictedTimingSamples = 0;
|
|
6228
6320
|
this.#rejectedMovieFragments = 0;
|
|
6321
|
+
this.#recoveredHeadsAwaitingTiming = {
|
|
6322
|
+
held: 0,
|
|
6323
|
+
expired: 0,
|
|
6324
|
+
discarded: 0,
|
|
6325
|
+
superseded: 0
|
|
6326
|
+
};
|
|
6229
6327
|
this.#sequencers = /* @__PURE__ */ new Map();
|
|
6230
6328
|
this.#fecGate = null;
|
|
6231
6329
|
this.#fecSequencer = null;
|
|
@@ -6334,6 +6432,7 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
6334
6432
|
#reclaimedTimingSamples;
|
|
6335
6433
|
#evictedTimingSamples;
|
|
6336
6434
|
#rejectedMovieFragments;
|
|
6435
|
+
#recoveredHeadsAwaitingTiming;
|
|
6337
6436
|
#sequencers;
|
|
6338
6437
|
#fecGate;
|
|
6339
6438
|
#fecSequencer;
|
|
@@ -6439,11 +6538,12 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
6439
6538
|
/**
|
|
6440
6539
|
* Typed view of the ISO-BMFF timing-sample budget.
|
|
6441
6540
|
*
|
|
6442
|
-
*
|
|
6443
|
-
*
|
|
6444
|
-
*
|
|
6445
|
-
*
|
|
6446
|
-
*
|
|
6541
|
+
* Each stream admits timing against its own window of `capacity` slots
|
|
6542
|
+
* (BLO-52085). A stream at capacity displaces its own oldest timing to
|
|
6543
|
+
* admit the moof in hand, and `evicted` counts the slots so displaced:
|
|
6544
|
+
* timing a stream declared and never delivered shows up there. `pending`
|
|
6545
|
+
* sums every stream, so it can exceed `capacity`. Per repo policy this is
|
|
6546
|
+
* a producer-owned counter -- never infer budget state by parsing logs.
|
|
6447
6547
|
*/
|
|
6448
6548
|
get timingBudgetStats() {
|
|
6449
6549
|
return {
|
|
@@ -6454,6 +6554,14 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
6454
6554
|
rejectedMovieFragments: this.#rejectedMovieFragments
|
|
6455
6555
|
};
|
|
6456
6556
|
}
|
|
6557
|
+
/** Recovered heads parked for FT=1 timing (BLO-53369). Survives dispose(). */
|
|
6558
|
+
get recoveredHeadsAwaitingTiming() {
|
|
6559
|
+
let pending = 0;
|
|
6560
|
+
for (const { awaitingTiming } of this.#timingStreams.values()) {
|
|
6561
|
+
for (const head of awaitingTiming) if (head.options?.recovered) pending++;
|
|
6562
|
+
}
|
|
6563
|
+
return { ...this.#recoveredHeadsAwaitingTiming, pending };
|
|
6564
|
+
}
|
|
6457
6565
|
get reorderStats() {
|
|
6458
6566
|
let bufferedFrames = this.#fecSequencer?.buffered ?? 0;
|
|
6459
6567
|
for (const { sequencer } of this.#sequencers.values()) bufferedFrames += sequencer.buffered;
|
|
@@ -6495,6 +6603,14 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
6495
6603
|
fecReleaseRapAbove(packetId, catalogTrackName, ssId) {
|
|
6496
6604
|
return this.#fecSequencer?.rapAbove(packetId, catalogTrackName, ssId) ?? false;
|
|
6497
6605
|
}
|
|
6606
|
+
/** See FecReleaseSequencer.unsource. */
|
|
6607
|
+
unsourceFecRelease(packetId, catalogTrackName) {
|
|
6608
|
+
this.#fecSequencer?.unsource(packetId, catalogTrackName);
|
|
6609
|
+
}
|
|
6610
|
+
/** See FecReleaseSequencer.holdsRebuilt. */
|
|
6611
|
+
fecReleaseHoldsRebuilt(packetId, catalogTrackName) {
|
|
6612
|
+
return this.#fecSequencer?.holdsRebuilt(packetId, catalogTrackName) ?? false;
|
|
6613
|
+
}
|
|
6498
6614
|
/** Re-evaluate held gaps after FEC block state changed. */
|
|
6499
6615
|
pokeFecRelease(packetId, catalogTrackName) {
|
|
6500
6616
|
if (!this.#fecSequencer) return;
|
|
@@ -6627,7 +6743,7 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
6627
6743
|
const now = Date.now();
|
|
6628
6744
|
for (const { awaitingTiming } of this.#timingStreams.values()) {
|
|
6629
6745
|
while (awaitingTiming.length > 0 && now - awaitingTiming[0].arrivedAt > timeoutMs) {
|
|
6630
|
-
awaitingTiming.shift();
|
|
6746
|
+
this.#leaveAwaitingTiming(awaitingTiming.shift(), "expired");
|
|
6631
6747
|
}
|
|
6632
6748
|
}
|
|
6633
6749
|
}
|
|
@@ -6748,7 +6864,7 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
6748
6864
|
if (!resolver2?.initialized) return this.#drop("fragment-no-resolver");
|
|
6749
6865
|
const pendingBefore = resolver2.pendingSampleCount;
|
|
6750
6866
|
const evictedBefore = resolver2.evictedSampleCount;
|
|
6751
|
-
const remaining = this.#maxPendingTimingSamples -
|
|
6867
|
+
const remaining = this.#maxPendingTimingSamples - resolver2.pendingSampleCount;
|
|
6752
6868
|
const admitted = resolver2.addMovieFragment(
|
|
6753
6869
|
mpu.mpuSequenceNumber,
|
|
6754
6870
|
data,
|
|
@@ -6795,6 +6911,7 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
6795
6911
|
mpuSequenceNumber: mpu.mpuSequenceNumber,
|
|
6796
6912
|
movieFragmentSequenceNumber: mfuDuHeader.movieFragmentSequenceNumber,
|
|
6797
6913
|
sampleNumber: mfuDuHeader.sampleNumber,
|
|
6914
|
+
sequenceNumber: info.sequenceNumber,
|
|
6798
6915
|
arrivedAt: Date.now()
|
|
6799
6916
|
});
|
|
6800
6917
|
return this.#drop("mfu-sample-timing-missing");
|
|
@@ -6820,7 +6937,8 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
6820
6937
|
info,
|
|
6821
6938
|
resolver,
|
|
6822
6939
|
options?.recovered === true,
|
|
6823
|
-
options?.fecSbn
|
|
6940
|
+
options?.fecSbn,
|
|
6941
|
+
options?.fecSbnFirst
|
|
6824
6942
|
);
|
|
6825
6943
|
if (deferred.record === void 0) this.#countDeferredOutcome(deferred.reason);
|
|
6826
6944
|
}
|
|
@@ -6913,7 +7031,8 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
6913
7031
|
info,
|
|
6914
7032
|
resolver,
|
|
6915
7033
|
options?.recovered === true,
|
|
6916
|
-
options?.fecSbn
|
|
7034
|
+
options?.fecSbn,
|
|
7035
|
+
options?.fecSbnFirst
|
|
6917
7036
|
);
|
|
6918
7037
|
if (outcome.record !== void 0) return outcome.record;
|
|
6919
7038
|
return this.#drop(outcome.reason);
|
|
@@ -6933,7 +7052,7 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
6933
7052
|
* attribution exists to keep readable. Leaving the choice at the call site
|
|
6934
7053
|
* is what keeps both true.
|
|
6935
7054
|
*/
|
|
6936
|
-
#emitCombinedSample(combined, info, resolver, recovered, fecSbn) {
|
|
7055
|
+
#emitCombinedSample(combined, info, resolver, recovered, fecSbn, fecSbnFirst) {
|
|
6937
7056
|
const timing = resolver.sampleTiming(
|
|
6938
7057
|
combined.mpuSequenceNumber,
|
|
6939
7058
|
combined.movieFragmentSequenceNumber,
|
|
@@ -6950,6 +7069,7 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
6950
7069
|
);
|
|
6951
7070
|
if (!meta) return { reason: "combined-meta-build-failed" };
|
|
6952
7071
|
if (fecSbn !== void 0) meta.fecSbn = fecSbn;
|
|
7072
|
+
if (fecSbnFirst !== void 0) meta.fecSbnFirst = fecSbnFirst;
|
|
6953
7073
|
if (!resolver.consumeSample(
|
|
6954
7074
|
combined.mpuSequenceNumber,
|
|
6955
7075
|
combined.movieFragmentSequenceNumber,
|
|
@@ -7183,6 +7303,9 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
7183
7303
|
for (const { sequencer } of this.#sequencers.values()) sequencer.discard();
|
|
7184
7304
|
this.#sequencers.clear();
|
|
7185
7305
|
this.#fecSequencer?.discard();
|
|
7306
|
+
for (const { awaitingTiming } of this.#timingStreams.values()) {
|
|
7307
|
+
for (const head of awaitingTiming) this.#leaveAwaitingTiming(head, "discarded");
|
|
7308
|
+
}
|
|
7186
7309
|
this.#timingStreams.clear();
|
|
7187
7310
|
this.#pendingTimingSamples = 0;
|
|
7188
7311
|
this.#reliableMoqStartupGate.clear();
|
|
@@ -7201,10 +7324,23 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
7201
7324
|
return resolver;
|
|
7202
7325
|
}
|
|
7203
7326
|
#awaitTiming(streamKey, head) {
|
|
7204
|
-
const
|
|
7205
|
-
if (!
|
|
7327
|
+
const state = this.#timingStreams.get(streamKey);
|
|
7328
|
+
if (!state) return;
|
|
7329
|
+
if (!head.options?.recovered) {
|
|
7330
|
+
const kept = state.awaitingTiming.filter((queued) => !queued.options?.recovered || queued.sequenceNumber !== head.sequenceNumber);
|
|
7331
|
+
this.#recoveredHeadsAwaitingTiming.superseded += state.awaitingTiming.length - kept.length;
|
|
7332
|
+
state.awaitingTiming = kept;
|
|
7333
|
+
}
|
|
7334
|
+
const awaitingTiming = state.awaitingTiming;
|
|
7206
7335
|
awaitingTiming.push(head);
|
|
7207
|
-
if (
|
|
7336
|
+
if (head.options?.recovered) this.#recoveredHeadsAwaitingTiming.held++;
|
|
7337
|
+
if (awaitingTiming.length > MAX_AWAITING_TIMING_HEADS) {
|
|
7338
|
+
this.#leaveAwaitingTiming(awaitingTiming.shift(), "expired");
|
|
7339
|
+
}
|
|
7340
|
+
}
|
|
7341
|
+
/** Count a recovered head leaving the queue other than by replay or its source copy. */
|
|
7342
|
+
#leaveAwaitingTiming(head, outcome) {
|
|
7343
|
+
if (head.options?.recovered) this.#recoveredHeadsAwaitingTiming[outcome]++;
|
|
7208
7344
|
}
|
|
7209
7345
|
/**
|
|
7210
7346
|
* Feed again the heads whose timing the FT=1 just admitted declares. That
|
|
@@ -7232,6 +7368,7 @@ var MmtpContainerParser = class _MmtpContainerParser {
|
|
|
7232
7368
|
const state = this.#timingStreams.get(streamKey);
|
|
7233
7369
|
if (!state) return;
|
|
7234
7370
|
this.#timingStreams.delete(streamKey);
|
|
7371
|
+
for (const head of state.awaitingTiming) this.#leaveAwaitingTiming(head, "discarded");
|
|
7235
7372
|
this.#pendingTimingSamples -= state.resolver.pendingSampleCount;
|
|
7236
7373
|
if (this.#pendingTimingSamples < 0) {
|
|
7237
7374
|
throw new Error("[MmtpContainerParser] pending timing sample accounting underflow");
|