mediabunny 1.50.5 → 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.
@@ -22622,10 +22622,16 @@ var Mediabunny = (() => {
22622
22622
  if (isChromium() && this.currentPacketIndex === 0) {
22623
22623
  if (this.codec === "avc") {
22624
22624
  const filteredNalUnits = [];
22625
+ let hasFrameData = false;
22625
22626
  for (const loc of iterateAvcNalUnits(packet.data, this.decoderConfig)) {
22626
22627
  const type = extractNalUnitTypeForAvc(packet.data[loc.offset]);
22628
+ hasFrameData ||= type >= 1 && type <= 5;
22627
22629
  if (type === 9 /* AUD */) {
22628
- filteredNalUnits.length = 0;
22630
+ if (hasFrameData) {
22631
+ break;
22632
+ } else {
22633
+ filteredNalUnits.length = 0;
22634
+ }
22629
22635
  }
22630
22636
  if (!(type >= 20 && type <= 31)) {
22631
22637
  filteredNalUnits.push(packet.data.subarray(loc.offset, loc.offset + loc.length));