mediabunny 1.32.0 → 1.32.2

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.
@@ -13797,6 +13797,7 @@ var Mediabunny = (() => {
13797
13797
  return 0;
13798
13798
  }
13799
13799
  async getPacketAtIndex(packetIndex, options) {
13800
+ assert(packetIndex >= 0);
13800
13801
  assert(this.demuxer.audioInfo);
13801
13802
  const startOffset = packetIndex * PACKET_SIZE_IN_FRAMES * this.demuxer.audioInfo.blockSizeInBytes;
13802
13803
  if (startOffset >= this.demuxer.dataSize) {
@@ -13826,7 +13827,7 @@ var Mediabunny = (() => {
13826
13827
  const duration = sizeInBytes / this.demuxer.audioInfo.blockSizeInBytes / this.demuxer.audioInfo.sampleRate;
13827
13828
  this.demuxer.lastKnownPacketIndex = Math.max(
13828
13829
  packetIndex,
13829
- timestamp
13830
+ this.demuxer.lastKnownPacketIndex
13830
13831
  );
13831
13832
  return new EncodedPacket(
13832
13833
  data,
@@ -13846,6 +13847,9 @@ var Mediabunny = (() => {
13846
13847
  timestamp * this.demuxer.audioInfo.sampleRate / PACKET_SIZE_IN_FRAMES,
13847
13848
  (this.demuxer.dataSize - 1) / (PACKET_SIZE_IN_FRAMES * this.demuxer.audioInfo.blockSizeInBytes)
13848
13849
  ));
13850
+ if (packetIndex < 0) {
13851
+ return null;
13852
+ }
13849
13853
  const packet = await this.getPacketAtIndex(packetIndex, options);
13850
13854
  if (packet) {
13851
13855
  return packet;