mediabunny 1.32.1 → 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,9 +13797,7 @@ var Mediabunny = (() => {
13797
13797
  return 0;
13798
13798
  }
13799
13799
  async getPacketAtIndex(packetIndex, options) {
13800
- if (packetIndex < 0) {
13801
- return null;
13802
- }
13800
+ assert(packetIndex >= 0);
13803
13801
  assert(this.demuxer.audioInfo);
13804
13802
  const startOffset = packetIndex * PACKET_SIZE_IN_FRAMES * this.demuxer.audioInfo.blockSizeInBytes;
13805
13803
  if (startOffset >= this.demuxer.dataSize) {
@@ -13849,6 +13847,9 @@ var Mediabunny = (() => {
13849
13847
  timestamp * this.demuxer.audioInfo.sampleRate / PACKET_SIZE_IN_FRAMES,
13850
13848
  (this.demuxer.dataSize - 1) / (PACKET_SIZE_IN_FRAMES * this.demuxer.audioInfo.blockSizeInBytes)
13851
13849
  ));
13850
+ if (packetIndex < 0) {
13851
+ return null;
13852
+ }
13852
13853
  const packet = await this.getPacketAtIndex(packetIndex, options);
13853
13854
  if (packet) {
13854
13855
  return packet;