mediabunny 1.50.4 → 1.50.6

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.
@@ -17112,7 +17112,7 @@ var Mediabunny = (() => {
17112
17112
  throw error;
17113
17113
  }
17114
17114
  }).finally(() => {
17115
- if (worker.running || this.workers.length >= this.options.maxWorkerCount) {
17115
+ if (worker.running) {
17116
17116
  return;
17117
17117
  }
17118
17118
  if (this.queuedReads.length > 0) {
@@ -17124,13 +17124,15 @@ var Mediabunny = (() => {
17124
17124
  }
17125
17125
  }
17126
17126
  const queuedRead = this.queuedReads[oldestIndex];
17127
- this.queuedReads.splice(oldestIndex, 1);
17128
17127
  const newWorker = this.createWorker(
17129
17128
  queuedRead.hole.start,
17130
17129
  queuedRead.hole.end,
17131
17130
  queuedRead.strictTarget
17132
17131
  );
17133
- assert(newWorker);
17132
+ if (!newWorker) {
17133
+ return;
17134
+ }
17135
+ this.queuedReads.splice(oldestIndex, 1);
17134
17136
  newWorker.pendingSlices = queuedRead.pendingSlices;
17135
17137
  this.runWorker(newWorker);
17136
17138
  }
@@ -22620,10 +22622,16 @@ var Mediabunny = (() => {
22620
22622
  if (isChromium() && this.currentPacketIndex === 0) {
22621
22623
  if (this.codec === "avc") {
22622
22624
  const filteredNalUnits = [];
22625
+ let hasFrameData = false;
22623
22626
  for (const loc of iterateAvcNalUnits(packet.data, this.decoderConfig)) {
22624
22627
  const type = extractNalUnitTypeForAvc(packet.data[loc.offset]);
22628
+ hasFrameData ||= type >= 1 && type <= 5;
22625
22629
  if (type === 9 /* AUD */) {
22626
- filteredNalUnits.length = 0;
22630
+ if (hasFrameData) {
22631
+ break;
22632
+ } else {
22633
+ filteredNalUnits.length = 0;
22634
+ }
22627
22635
  }
22628
22636
  if (!(type >= 20 && type <= 31)) {
22629
22637
  filteredNalUnits.push(packet.data.subarray(loc.offset, loc.offset + loc.length));
@@ -24089,7 +24097,7 @@ var Mediabunny = (() => {
24089
24097
  return requireSync(this._backing.getCodec(), "codec", "getCodec");
24090
24098
  }
24091
24099
  async hasOnlyKeyPackets() {
24092
- return await this._backing.getHasOnlyKeyPackets?.() ?? false;
24100
+ return await this._backing.getHasOnlyKeyPackets?.() ?? await this._backing.getCodec() === "prores";
24093
24101
  }
24094
24102
  /** Returns the width in pixels of the track's coded samples, before any transformations or rotations. */
24095
24103
  async getCodedWidth() {