@blockcast/mmt-container 2.2.0-main.02321582f1ca → 2.2.0-main.079cd7664c0b

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.
@@ -22994,10 +22994,6 @@ function overlayBaseSsId(anchor, overlaySsId, restoredPsn, headerPsn) {
22994
22994
  if (anchor.baseSsId === void 0 || headerPsn !== restoredPsn) return void 0;
22995
22995
  return serial32Add(anchor.baseSsId, overlaySsId - anchor.overlaySsId | 0);
22996
22996
  }
22997
- function unstampedBaseSsId(offset, unstampedOffset, headerPsn) {
22998
- if (offset === void 0 || offset !== unstampedOffset) return void 0;
22999
- return headerPsn + offset >>> 0;
23000
- }
23001
22997
  var OVERLAY_ROUTED_LIMIT = 1024;
23002
22998
  var OVERLAY_PENDING_LIMIT = 256;
23003
22999
  var OVERLAY_OFFSET_MPUS = 16;
@@ -23167,14 +23163,6 @@ var MmtpRouter = class {
23167
23163
  * sequence is its SS_ID minus this; see #routeProcessedFecSymbols.
23168
23164
  */
23169
23165
  #ssIdSeqOffsetByStream = /* @__PURE__ */ new Map();
23170
- /**
23171
- * Per stream, the SS_ID offset at which a base recovery last showed the
23172
- * sender's own packet_sequence_number: a recovered packet's header psn
23173
- * equal to its SS_ID minus that offset. While it equals the stream's
23174
- * current offset, no hop re-stamps the stream and a packet's protected psn
23175
- * names its base SS_ID (joint decoding of an MPU no member of which arrived).
23176
- */
23177
- #unstampedSsIdSeqOffsetByStream = /* @__PURE__ */ new Map();
23178
23166
  /**
23179
23167
  * Streams whose multicast leg delivered a RAP-flagged source packet that was
23180
23168
  * not parsed, typically because its overlap copy was parsed first
@@ -24031,15 +24019,7 @@ var MmtpRouter = class {
24031
24019
  if (baseSsId !== void 0) baseSsIds.set(out, baseSsId);
24032
24020
  return [out];
24033
24021
  }
24034
- if (!restamped) {
24035
- const baseSsId = unstampedBaseSsId(
24036
- this.#ssIdSeqOffsetByStream.get(streamKey),
24037
- this.#unstampedSsIdSeqOffsetByStream.get(streamKey),
24038
- sym.packetSequenceNumber
24039
- );
24040
- if (baseSsId !== void 0) baseSsIds.set(sym, baseSsId);
24041
- return [sym];
24042
- }
24022
+ if (!restamped) return [sym];
24043
24023
  this.#overlayStats.unsequencedDropped++;
24044
24024
  return [];
24045
24025
  });
@@ -24052,8 +24032,7 @@ var MmtpRouter = class {
24052
24032
  }
24053
24033
  /**
24054
24034
  * Joint decoding (BLO-52085). A packet the overlay rebuilt is a source of
24055
- * its base block too, once its base SS_ID is determined (overlayBaseSsId,
24056
- * from a received member of its MPU, else unstampedBaseSsId),
24035
+ * its base block too, once its base SS_ID is determined (overlayBaseSsId),
24057
24036
  * so it is fed to the base decoder as a rebuilt source
24058
24037
  * (FECManager.feedRebuiltSourceSymbol): the base block has one erasure
24059
24038
  * fewer to solve, and its repair can recover the block's other packets.
@@ -24089,10 +24068,7 @@ var MmtpRouter = class {
24089
24068
  if (routed.size > OVERLAY_ROUTED_LIMIT) routed.delete(routed.values().next().value);
24090
24069
  feeds.push([ssId, sym.rawSymbol]);
24091
24070
  }
24092
- for (const [ssId, symbolData] of feeds) {
24093
- if (this.#classifyPacketId(owner) === null) return;
24094
- this.#feedRebuiltToBase(owner, name, ssId, symbolData);
24095
- }
24071
+ for (const [ssId, symbolData] of feeds) this.#feedRebuiltToBase(owner, name, ssId, symbolData);
24096
24072
  }
24097
24073
  /** Feed one rebuilt source to its base block, or keep it until a repair states that block. */
24098
24074
  #feedRebuiltToBase(owner, name, ssId, symbolData) {
@@ -24102,7 +24078,7 @@ var MmtpRouter = class {
24102
24078
  if (coords == null) {
24103
24079
  const pending = this.#stream(owner, name).overlayToBase.pending;
24104
24080
  pending.delete(ssId);
24105
- pending.set(ssId, symbolData.slice());
24081
+ pending.set(ssId, symbolData);
24106
24082
  if (pending.size > OVERLAY_PENDING_LIMIT) pending.delete(pending.keys().next().value);
24107
24083
  return;
24108
24084
  }
@@ -24122,7 +24098,6 @@ var MmtpRouter = class {
24122
24098
  const pending = this.#streams.get(owner)?.get(name)?.overlayToBase.pending;
24123
24099
  if (pending === void 0 || pending.size === 0) return;
24124
24100
  for (const [ssId, symbolData] of [...pending]) {
24125
- if (this.#classifyPacketId(owner) === null) return;
24126
24101
  if (serial32Distance(block.start, ssId) >= block.length) continue;
24127
24102
  pending.delete(ssId);
24128
24103
  this.#feedRebuiltToBase(owner, name, ssId, symbolData);
@@ -24742,6 +24717,8 @@ var MmtpRouter = class {
24742
24717
  }
24743
24718
  this.#replayIsoSources(ownerPacketId, catalogTrackName, blockStart, placement.placed);
24744
24719
  if (this.#classifyPacketId(ownerPacketId) === null) return;
24720
+ this.#feedPendingRebuilt(ownerPacketId, catalogTrackName, placement.block);
24721
+ if (this.#classifyPacketId(ownerPacketId) === null) return;
24745
24722
  if (!this.#feedFecTransportSymbol(
24746
24723
  ownerPacketId,
24747
24724
  blockStart,
@@ -24752,8 +24729,6 @@ var MmtpRouter = class {
24752
24729
  )) return;
24753
24730
  fec.noteBlockActivity?.(blockStart, ownerPacketId, catalogTrackName);
24754
24731
  fec.noteRepairGroupLength?.(blockStart, ownerPacketId, repair.rsbLength, catalogTrackName);
24755
- this.#feedPendingRebuilt(ownerPacketId, catalogTrackName, placement.block);
24756
- if (this.#classifyPacketId(ownerPacketId) === null) return;
24757
24732
  const alreadyCompleted = fec.isBlockCompleted(blockStart, ownerPacketId, catalogTrackName);
24758
24733
  const recovered = fec.feedRepairSymbol(
24759
24734
  ownerPacketId,
@@ -24891,7 +24866,6 @@ var MmtpRouter = class {
24891
24866
  this.#droppedPreSyncVideo.delete(streamKey);
24892
24867
  this.#latestVideoSeqByStream.delete(streamKey);
24893
24868
  this.#ssIdSeqOffsetByStream.delete(streamKey);
24894
- this.#unstampedSsIdSeqOffsetByStream.delete(streamKey);
24895
24869
  this.#multicastRapTwinByStream.delete(streamKey);
24896
24870
  this.#lastDirectSourceVideoTsByStream.delete(streamKey);
24897
24871
  this.#lastDirectEmittedVideoTsByStream.delete(streamKey);
@@ -26308,10 +26282,7 @@ var MmtpRouter = class {
26308
26282
  ...result,
26309
26283
  symbols: result.symbols.map((sym) => {
26310
26284
  const wire = this.#fecAnchorForRecovered(blockId, sym.index) - ssIdSeqOffset >>> 0;
26311
- if (wire === sym.packetSequenceNumber) {
26312
- this.#unstampedSsIdSeqOffsetByStream.set(streamKey, ssIdSeqOffset);
26313
- return sym;
26314
- }
26285
+ if (wire === sym.packetSequenceNumber) return sym;
26315
26286
  this.#restampedRecoveredSeqs++;
26316
26287
  this.#restampedStreams.add(streamKey);
26317
26288
  return { ...sym, packetSequenceNumber: wire };