@ahmedrowaihi/mediabunny 1.65.2-beta.700 → 1.65.2-beta.701

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.
@@ -43317,7 +43317,11 @@ var Mediabunny = (() => {
43317
43317
  assert(trackData.lastSample);
43318
43318
  const timescaleUnits = intoTimescale(sample.decodeTimestamp, trackData.timescale, false);
43319
43319
  const delta = Math.round(timescaleUnits - trackData.lastTimescaleUnits);
43320
- assert(delta >= 0);
43320
+ if (delta < 0) {
43321
+ throw new Error(
43322
+ `Decode timestamps must not go backwards, but a packet presenting at ${sample.timestamp}s states a decode timestamp of ${sample.decodeTimestamp}s, which is before the previous packet's ${trackData.lastTimescaleUnits / trackData.timescale}s. Packets that state a decode timestamp must be added in decode order.`
43323
+ );
43324
+ }
43321
43325
  trackData.lastTimescaleUnits += delta;
43322
43326
  trackData.lastSample.timescaleUnitsToNextSample = delta;
43323
43327
  if (!this.isFragmented) {