libav-wasm 0.8.12 → 0.8.13

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.
package/README.md CHANGED
@@ -80,6 +80,9 @@ cannot follow, and a thumbnailer has no muxer to damage.
80
80
  the library and the worker, and emits types. Only the last step re-runs when you touch C++, so the loop is
81
81
  about 25 seconds.
82
82
 
83
+ ffmpeg is built with every patch in [patches/](./patches) applied, each saying at its head what it changes and
84
+ why. Adding or editing one rebuilds ffmpeg on the next `npm run build`, which took 99 seconds here.
85
+
83
86
  ### Two builds, one source
84
87
 
85
88
  `make` emits **both** `libav.wasm` and `libav-jspi.wasm`, and the worker picks between them at runtime on
@@ -97,10 +100,10 @@ byte-identical output, not merely "it ran".
97
100
 
98
101
  ## Tests
99
102
 
100
- `npm test` runs a browser suite against fixtures it synthesizes with ffmpeg on first run. Nothing is
101
- committed and nothing is anyone's content, so there is no copyright question and no multi-megabyte blob in
102
- git history: what matters for a remuxer is a file's structure, and every fixture exists because a real bug
103
- needed exactly that structure to show up.
103
+ `npm test` runs a browser suite against fixtures it synthesizes with ffmpeg (and mkvmerge, for the files with
104
+ two chapter editions) on first run. Nothing is committed and nothing is anyone's content, so there is no
105
+ copyright question and no multi-megabyte blob in git history: what matters for a remuxer is a file's
106
+ structure, and every fixture exists because a real bug needed exactly that structure to show up.
104
107
 
105
108
  Each fixture encodes its own timestamp in the frame's colour, so a decoded thumbnail can be checked back to
106
109
  the second it came from. Without that the only available assertion is "some bytes came back", which is how
package/build/index.js CHANGED
@@ -1,7 +1,6 @@
1
- //#region \0/home/runner/work/libav-wasm/libav-wasm/node_modules/eventemitter3/index.js?commonjs-module
1
+ // \0/home/runner/work/libav-wasm/libav-wasm/node_modules/eventemitter3/index.js?commonjs-module
2
2
  var eventemitter3Exports = {};
3
- //#endregion
4
- //#region node_modules/eventemitter3/index.js
3
+ // node_modules/eventemitter3/index.js
5
4
  (function(module) {
6
5
  "use strict";
7
6
  var has = Object.prototype.hasOwnProperty, prefix = "~";
@@ -244,8 +243,7 @@ var eventemitter3Exports = {};
244
243
  }
245
244
  });
246
245
  var eventemitter3_default = eventemitter3Exports;
247
- //#endregion
248
- //#region node_modules/p-timeout/index.js
246
+ // node_modules/p-timeout/index.js
249
247
  var TimeoutError = class extends Error {
250
248
  constructor(message) {
251
249
  super(message);
@@ -326,8 +324,7 @@ function pTimeout(promise, milliseconds, fallback, options) {
326
324
  };
327
325
  return cancelablePromise;
328
326
  }
329
- //#endregion
330
- //#region node_modules/p-queue/dist/lower-bound.js
327
+ // node_modules/p-queue/dist/lower-bound.js
331
328
  function lowerBound(array, value, comparator) {
332
329
  let first = 0;
333
330
  let count = array.length;
@@ -341,8 +338,7 @@ function lowerBound(array, value, comparator) {
341
338
  }
342
339
  return first;
343
340
  }
344
- //#endregion
345
- //#region node_modules/p-queue/dist/priority-queue.js
341
+ // node_modules/p-queue/dist/priority-queue.js
346
342
  var __classPrivateFieldGet$1 = function(receiver, state, kind, f) {
347
343
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
348
344
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
@@ -381,8 +377,7 @@ var PriorityQueue = class {
381
377
  }
382
378
  };
383
379
  _PriorityQueue_queue = /* @__PURE__ */ new WeakMap();
384
- //#endregion
385
- //#region node_modules/p-queue/dist/index.js
380
+ // node_modules/p-queue/dist/index.js
386
381
  var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
387
382
  if (kind === "m") throw new TypeError("Private method is not writable");
388
383
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -677,8 +672,7 @@ _PQueue_carryoverConcurrencyCount = /* @__PURE__ */ new WeakMap(), _PQueue_isInt
677
672
  this.on(event, listener);
678
673
  });
679
674
  };
680
- //#endregion
681
- //#region node_modules/osra/build/index.js
675
+ // node_modules/osra/build/index.js
682
676
  var e = Object.defineProperty;
683
677
  var t = (t, n) => {
684
678
  let r = {};
@@ -2778,8 +2772,7 @@ var ai = (e, { transport: t, name: i, remoteName: a, key: o = r, origin: s = "*"
2778
2772
  return $r(b, y, h);
2779
2773
  };
2780
2774
  var oi = (e, t) => ai(e, t);
2781
- //#endregion
2782
- //#region src/utils.ts
2775
+ // src/utils.ts
2783
2776
  function debounceImmediateAndLatest(wait, func) {
2784
2777
  let timeoutId = null;
2785
2778
  let lastArgs = null;
@@ -2849,8 +2842,7 @@ var queuedThrottleWithLastCall = (time, func) => {
2849
2842
  } else return lastCall;
2850
2843
  };
2851
2844
  };
2852
- //#endregion
2853
- //#region src/index.ts
2845
+ // src/index.ts
2854
2846
  /**
2855
2847
  * The codecs a browser might take in an mp4, and the string to ask about each one by.
2856
2848
  *
@@ -3014,5 +3006,4 @@ var makeThumbnailer = async (options) => {
3014
3006
  destroy
3015
3007
  };
3016
3008
  };
3017
- //#endregion
3018
3009
  export { debounceImmediateAndLatest, makeRemuxer, makeThumbnailer, queuedThrottleWithLastCall, supportedAudioCodecs };
Binary file
package/build/libav.wasm CHANGED
Binary file
package/build/worker.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region node_modules/osra/build/index.js
1
+ // node_modules/osra/build/index.js
2
2
  var e = Object.defineProperty, t = (t, n) => {
3
3
  let r = {};
4
4
  for (var i in t) e(r, i, {
@@ -462,24 +462,23 @@ var e = Object.defineProperty, t = (t, n) => {
462
462
  mt.set(e, t), e.eventTarget.addEventListener("message", ({ detail: n }) => {
463
463
  if (n.type !== "message" && n.type !== "message-port-close" || t.tombstones.has(n.portId)) return;
464
464
  let r = t.ports.get(n.portId);
465
- if (n.seq === void 0) {
466
- r?.handler?.(n);
467
- return;
468
- }
469
- if (!r) {
470
- if (t.pendingPorts >= pt) return;
471
- r = gt(t, n.portId);
472
- }
473
- if (!(n.seq < r.nextSeq)) {
474
- if (r.buffer.size >= ft && !(n.seq === r.nextSeq && r.handler)) {
475
- r.buffer.clear(), _t(t, n.portId), r.handler?.({
476
- type: "message-port-close",
477
- remoteUuid: e.remoteUuid,
478
- portId: n.portId
479
- });
480
- return;
465
+ if (n.seq === void 0) r?.handler?.(n);
466
+ else {
467
+ if (!r) {
468
+ if (t.pendingPorts >= pt) return;
469
+ r = gt(t, n.portId);
470
+ }
471
+ if (!(n.seq < r.nextSeq)) {
472
+ if (r.buffer.size >= ft && !(n.seq === r.nextSeq && r.handler)) {
473
+ r.buffer.clear(), _t(t, n.portId), r.handler?.({
474
+ type: "message-port-close",
475
+ remoteUuid: e.remoteUuid,
476
+ portId: n.portId
477
+ });
478
+ return;
479
+ }
480
+ r.buffer.set(n.seq, n), vt(r);
481
481
  }
482
- r.buffer.set(n.seq, n), vt(r);
483
482
  }
484
483
  }), Je(e, () => {
485
484
  for (let [n, r] of [...t.ports]) r.handler?.({
@@ -538,11 +537,7 @@ var e = Object.defineProperty, t = (t, n) => {
538
537
  let t = s.deref();
539
538
  t?.removeEventListener("message", p), t instanceof R && (t._onClose = void 0);
540
539
  }, f = (e) => {
541
- if (e.type === "message-port-close") {
542
- d(), a.dispatchEvent(new Event("close")), a.close();
543
- return;
544
- }
545
- Tt(e.data, t, (e) => wt(a, e, !1), () => {});
540
+ e.type === "message-port-close" ? (d(), a.dispatchEvent(new Event("close")), a.close()) : Tt(e.data, t, (e) => wt(a, e, !1), () => {});
546
541
  };
547
542
  function p({ data: e }) {
548
543
  t.sendMessage({
@@ -582,21 +577,13 @@ var e = Object.defineProperty, t = (t, n) => {
582
577
  let a = nt(() => Z(r, t)), o = ct(a), s = Array.isArray(i) ? i : [], c = s.length ? [...o, ...s] : o, l = () => {
583
578
  e.postMessage(a, c), H(c);
584
579
  };
585
- if (n && !n.shipped) {
586
- n.pending.push(l);
587
- return;
588
- }
589
- l();
580
+ n && !n.shipped ? n.pending.push(l) : l();
590
581
  }, r.start = () => e.start();
591
582
  let s = () => {
592
583
  e.removeEventListener("message", i), e.removeEventListener("messageerror", a), e.removeEventListener("close", o), e.close();
593
584
  };
594
585
  return r.close = () => {
595
- if (n && !n.shipped) {
596
- n.pending.push(s);
597
- return;
598
- }
599
- s();
586
+ n && !n.shipped ? n.pending.push(s) : s();
600
587
  }, r;
601
588
  }, Ft = (e) => {
602
589
  if (O(e.transport)) {
@@ -681,15 +668,11 @@ var e = Object.defineProperty, t = (t, n) => {
681
668
  let a, o = () => {
682
669
  n.close(), Bt.delete(n), a?.();
683
670
  };
684
- if (r && Ye(t)) {
685
- i(/* @__PURE__ */ Error("osra: connection closed")), o();
686
- return;
687
- }
688
- a = r ? Je(t, () => {
671
+ r && Ye(t) ? (i(/* @__PURE__ */ Error("osra: connection closed")), o()) : (a = r ? Je(t, () => {
689
672
  i(/* @__PURE__ */ Error("osra: connection closed")), o();
690
673
  }) : void 0, n.addEventListener("message", ({ data: t }) => {
691
674
  t.type === "resolve" ? e(t.data) : i(t.error), o();
692
- }, { once: !0 }), n.start();
675
+ }, { once: !0 }), n.start());
693
676
  });
694
677
  }, Ut = /* @__PURE__ */ t({
695
678
  box: () => Jt,
@@ -1478,11 +1461,7 @@ var e = Object.defineProperty, t = (t, n) => {
1478
1461
  revive: (e, t) => ({})
1479
1462
  }
1480
1463
  ], Ar = (e, t) => t.find((t) => t.type === e.type), jr = (e) => !!e && typeof e == "object" && Object.getPrototypeOf(e) === Object.prototype, Mr = (e, t) => Array.isArray(e) ? e.map((e) => t(e)) : jr(e) ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, t(n)])) : e, Nr = /* @__PURE__ */ new WeakSet(), Pr = /* @__PURE__ */ new WeakSet(), Fr = 0, Ir = [], Lr = (e, t) => {
1481
- if (Fr === 0) {
1482
- e();
1483
- return;
1484
- }
1485
- Ir.push({
1464
+ Fr === 0 ? e() : Ir.push({
1486
1465
  commit: e,
1487
1466
  rollback: t
1488
1467
  });
@@ -1681,14 +1660,10 @@ var e = Object.defineProperty, t = (t, n) => {
1681
1660
  }
1682
1661
  for (let e of t) {
1683
1662
  let t = e.wake;
1684
- if (t) {
1685
- e.wake = void 0, t({
1686
- value: r,
1687
- done: !1
1688
- });
1689
- continue;
1690
- }
1691
- e.buffered.push(r);
1663
+ t ? (e.wake = void 0, t({
1664
+ value: r,
1665
+ done: !1
1666
+ })) : e.buffered.push(r);
1692
1667
  }
1693
1668
  }
1694
1669
  },
@@ -1780,14 +1755,10 @@ var e = Object.defineProperty, t = (t, n) => {
1780
1755
  rejectRemoteValue: S,
1781
1756
  abortConnection: (e) => {
1782
1757
  let t = _.get(e);
1783
- if (!t) {
1784
- v.add(e);
1785
- return;
1786
- }
1787
- _.delete(e), w({
1758
+ t ? (_.delete(e), w({
1788
1759
  type: "close",
1789
1760
  remoteUuid: e
1790
- }), Xe(t.connection.revivableContext), S(/* @__PURE__ */ Error("osra: connection aborted"));
1761
+ }), Xe(t.connection.revivableContext), S(/* @__PURE__ */ Error("osra: connection aborted"))) : v.add(e);
1791
1762
  },
1792
1763
  claimPendingAbort: (e) => v.delete(e),
1793
1764
  addConnection: (e, t) => {
@@ -1828,8 +1799,7 @@ var e = Object.defineProperty, t = (t, n) => {
1828
1799
  for (let e of $r) e.init(te);
1829
1800
  return Xr(b, y, h);
1830
1801
  }, ti = (e, t) => ei(e, t), ni = {};
1831
- //#endregion
1832
- //#region dist/libav.js
1802
+ // dist/libav.js
1833
1803
  (function(e, t) {
1834
1804
  var n = (() => {
1835
1805
  var e = typeof document < "u" ? document.currentScript?.src : void 0;
@@ -1951,20 +1921,18 @@ var e = Object.defineProperty, t = (t, n) => {
1951
1921
  if (i - t > 16 && e.buffer && Te) return Te.decode(e.subarray(t, i));
1952
1922
  for (var a = ""; t < i;) {
1953
1923
  var o = e[t++];
1954
- if (!(o & 128)) {
1955
- a += String.fromCharCode(o);
1956
- continue;
1957
- }
1958
- var s = e[t++] & 63;
1959
- if ((o & 224) == 192) {
1960
- a += String.fromCharCode((o & 31) << 6 | s);
1961
- continue;
1962
- }
1963
- var c = e[t++] & 63;
1964
- if (o = (o & 240) == 224 ? (o & 15) << 12 | s << 6 | c : (o & 7) << 18 | s << 12 | c << 6 | e[t++] & 63, o < 65536) a += String.fromCharCode(o);
1924
+ if (!(o & 128)) a += String.fromCharCode(o);
1965
1925
  else {
1966
- var l = o - 65536;
1967
- a += String.fromCharCode(55296 | l >> 10, 56320 | l & 1023);
1926
+ var s = e[t++] & 63;
1927
+ if ((o & 224) == 192) a += String.fromCharCode((o & 31) << 6 | s);
1928
+ else {
1929
+ var c = e[t++] & 63;
1930
+ if (o = (o & 240) == 224 ? (o & 15) << 12 | s << 6 | c : (o & 7) << 18 | s << 12 | c << 6 | e[t++] & 63, o < 65536) a += String.fromCharCode(o);
1931
+ else {
1932
+ var l = o - 65536;
1933
+ a += String.fromCharCode(55296 | l >> 10, 56320 | l & 1023);
1934
+ }
1935
+ }
1968
1936
  }
1969
1937
  }
1970
1938
  return a;
@@ -2209,7 +2177,7 @@ var e = Object.defineProperty, t = (t, n) => {
2209
2177
  }, xt = {}, St = {}, Ct = (e, t) => {
2210
2178
  for (t === void 0 && z("ptr should not be undefined"); e.baseClass;) t = e.upcast(t), e = e.baseClass;
2211
2179
  return t;
2212
- }, wt = (e, t) => (t = Ct(e, t), St[t]), Tt = (e, t) => ((!t.ptrType || !t.ptr) && rt("makeClassHandle requires ptr and ptrType"), !!t.smartPtrType != !!t.smartPtr && rt("Both smartPtrType and smartPtr must be specified"), t.count = { value: 1 }, Dt(Object.create(e, { $$: {
2180
+ }, wt = (e, t) => (t = Ct(e, t), St[t]), Tt = (e, t) => (t.ptrType && t.ptr || rt("makeClassHandle requires ptr and ptrType"), !!t.smartPtrType != !!t.smartPtr && rt("Both smartPtrType and smartPtr must be specified"), t.count = { value: 1 }, Dt(Object.create(e, { $$: {
2213
2181
  value: t,
2214
2182
  writable: !0
2215
2183
  } })));
@@ -2317,7 +2285,7 @@ var e = Object.defineProperty, t = (t, n) => {
2317
2285
  function U(e, t) {
2318
2286
  var n;
2319
2287
  if (t === null) return this.isReference && z(`null is not a valid ${this.name}`), this.isSmartPointer ? (n = this.rawConstructor(), e !== null && e.push(this.rawDestructor, n), n) : 0;
2320
- (!t || !t.$$) && z(`Cannot pass "${ot(t)}" as a ${this.name}`), t.$$.ptr || z(`Cannot pass deleted object as a pointer of type ${this.name}`), !this.isConst && t.$$.ptrType.isConst && z(`Cannot convert argument of type ${t.$$.smartPtrType ? t.$$.smartPtrType.name : t.$$.ptrType.name} to parameter type ${this.name}`);
2288
+ t && t.$$ || z(`Cannot pass "${ot(t)}" as a ${this.name}`), t.$$.ptr || z(`Cannot pass deleted object as a pointer of type ${this.name}`), !this.isConst && t.$$.ptrType.isConst && z(`Cannot convert argument of type ${t.$$.smartPtrType ? t.$$.smartPtrType.name : t.$$.ptrType.name} to parameter type ${this.name}`);
2321
2289
  var r = t.$$.ptrType.registeredClass;
2322
2290
  if (n = zt(t.$$.ptr, r, this.registeredClass), this.isSmartPointer) switch (t.$$.smartPtr === void 0 && z("Passing raw pointer to smart pointer is illegal"), this.sharingPolicy) {
2323
2291
  case 0:
@@ -2387,13 +2355,7 @@ var e = Object.defineProperty, t = (t, n) => {
2387
2355
  }, Zt = (e, t) => {
2388
2356
  var n = [], r = {};
2389
2357
  function i(e) {
2390
- if (!r[e] && !L[e]) {
2391
- if (tt[e]) {
2392
- tt[e].forEach(i);
2393
- return;
2394
- }
2395
- n.push(e), r[e] = !0;
2396
- }
2358
+ r[e] || L[e] || (tt[e] ? tt[e].forEach(i) : (n.push(e), r[e] = !0));
2397
2359
  }
2398
2360
  throw t.forEach(i), new Yt(`${e}: ` + n.map(Xt).join([", "]));
2399
2361
  }, Qt = (e, t, n, r, i, a, o, s, c, l, u, d, f) => {
@@ -3143,12 +3105,12 @@ var e = Object.defineProperty, t = (t, n) => {
3143
3105
  var oi = r.dynCall_iiiji = Y.Vb;
3144
3106
  r.dynCall_iiijjji = Y.Wb, r.dynCall_jiiij = Y.Xb, r.dynCall_iiiiij = Y.Yb, r.dynCall_iiiiiij = Y.Zb, r.dynCall_jiiji = Y._b;
3145
3107
  var si = r.dynCall_viiid = Y.$b, ci = r.dynCall_viiidii = Y.ac;
3146
- r.dynCall_viif = Y.bc, r.dynCall_dii = Y.cc, r.dynCall_viid = Y.dc, r.dynCall_diji = Y.ec, r.dynCall_iiiid = Y.fc;
3147
- var li = r.dynCall_iid = Y.gc, ui = r.dynCall_iiiiiiiiiii = Y.hc;
3148
- r.dynCall_iiiidii = Y.ic;
3149
- var di = r.dynCall_di = Y.jc, fi = r.dynCall_vid = Y.kc, pi = r.dynCall_vij = Y.lc;
3150
- r.dynCall_diiii = Y.mc, r.dynCall_iidiiii = Y.nc;
3151
- var mi = Y.oc, hi = Y.pc, gi = Y.qc, _i = Y.rc;
3108
+ r.dynCall_dii = Y.bc, r.dynCall_viid = Y.cc, r.dynCall_diji = Y.dc, r.dynCall_iiiid = Y.ec;
3109
+ var li = r.dynCall_iid = Y.fc, ui = r.dynCall_iiiiiiiiiii = Y.gc;
3110
+ r.dynCall_iiiidii = Y.hc;
3111
+ var di = r.dynCall_di = Y.ic, fi = r.dynCall_vid = Y.jc, pi = r.dynCall_vij = Y.kc;
3112
+ r.dynCall_diiii = Y.lc, r.dynCall_iidiiii = Y.mc;
3113
+ var mi = Y.nc, hi = Y.oc, gi = Y.pc, _i = Y.qc;
3152
3114
  r._ff_h264_cabac_tables = 1216105;
3153
3115
  function vi(e, t, n, r) {
3154
3116
  var i = j();
@@ -3332,11 +3294,7 @@ var e = Object.defineProperty, t = (t, n) => {
3332
3294
  }
3333
3295
  r.getExceptionMessage = Rr;
3334
3296
  function Ri() {
3335
- if (D > 0) {
3336
- ce = Ri;
3337
- return;
3338
- }
3339
- if (ae(), D > 0) {
3297
+ if (D > 0 || (ae(), D > 0)) {
3340
3298
  ce = Ri;
3341
3299
  return;
3342
3300
  }
@@ -3361,8 +3319,7 @@ var e = Object.defineProperty, t = (t, n) => {
3361
3319
  }
3362
3320
  }, ni);
3363
3321
  var ri = ni, ii = {};
3364
- //#endregion
3365
- //#region dist/libav-jspi.js
3322
+ // dist/libav-jspi.js
3366
3323
  (function(e, t) {
3367
3324
  var n = (() => {
3368
3325
  var e = typeof document < "u" ? document.currentScript?.src : void 0;
@@ -3481,20 +3438,18 @@ var ri = ni, ii = {};
3481
3438
  if (i - t > 16 && e.buffer && Se) return Se.decode(e.subarray(t, i));
3482
3439
  for (var a = ""; t < i;) {
3483
3440
  var o = e[t++];
3484
- if (!(o & 128)) {
3485
- a += String.fromCharCode(o);
3486
- continue;
3487
- }
3488
- var s = e[t++] & 63;
3489
- if ((o & 224) == 192) {
3490
- a += String.fromCharCode((o & 31) << 6 | s);
3491
- continue;
3492
- }
3493
- var c = e[t++] & 63;
3494
- if (o = (o & 240) == 224 ? (o & 15) << 12 | s << 6 | c : (o & 7) << 18 | s << 12 | c << 6 | e[t++] & 63, o < 65536) a += String.fromCharCode(o);
3441
+ if (!(o & 128)) a += String.fromCharCode(o);
3495
3442
  else {
3496
- var l = o - 65536;
3497
- a += String.fromCharCode(55296 | l >> 10, 56320 | l & 1023);
3443
+ var s = e[t++] & 63;
3444
+ if ((o & 224) == 192) a += String.fromCharCode((o & 31) << 6 | s);
3445
+ else {
3446
+ var c = e[t++] & 63;
3447
+ if (o = (o & 240) == 224 ? (o & 15) << 12 | s << 6 | c : (o & 7) << 18 | s << 12 | c << 6 | e[t++] & 63, o < 65536) a += String.fromCharCode(o);
3448
+ else {
3449
+ var l = o - 65536;
3450
+ a += String.fromCharCode(55296 | l >> 10, 56320 | l & 1023);
3451
+ }
3452
+ }
3498
3453
  }
3499
3454
  }
3500
3455
  return a;
@@ -3681,7 +3636,7 @@ var ri = ni, ii = {};
3681
3636
  }, R = {}, lt = {}, z = (e, t) => {
3682
3637
  for (t === void 0 && P("ptr should not be undefined"); e.baseClass;) t = e.upcast(t), e = e.baseClass;
3683
3638
  return t;
3684
- }, ut = (e, t) => (t = z(e, t), lt[t]), B = (e, t) => ((!t.ptrType || !t.ptr) && Ke("makeClassHandle requires ptr and ptrType"), !!t.smartPtrType != !!t.smartPtr && Ke("Both smartPtrType and smartPtr must be specified"), t.count = { value: 1 }, ft(Object.create(e, { $$: {
3639
+ }, ut = (e, t) => (t = z(e, t), lt[t]), B = (e, t) => (t.ptrType && t.ptr || Ke("makeClassHandle requires ptr and ptrType"), !!t.smartPtrType != !!t.smartPtr && Ke("Both smartPtrType and smartPtr must be specified"), t.count = { value: 1 }, ft(Object.create(e, { $$: {
3685
3640
  value: t,
3686
3641
  writable: !0
3687
3642
  } })));
@@ -3789,7 +3744,7 @@ var ri = ni, ii = {};
3789
3744
  function Et(e, t) {
3790
3745
  var n;
3791
3746
  if (t === null) return this.isReference && P(`null is not a valid ${this.name}`), this.isSmartPointer ? (n = this.rawConstructor(), e !== null && e.push(this.rawDestructor, n), n) : 0;
3792
- (!t || !t.$$) && P(`Cannot pass "${Ye(t)}" as a ${this.name}`), t.$$.ptr || P(`Cannot pass deleted object as a pointer of type ${this.name}`), !this.isConst && t.$$.ptrType.isConst && P(`Cannot convert argument of type ${t.$$.smartPtrType ? t.$$.smartPtrType.name : t.$$.ptrType.name} to parameter type ${this.name}`);
3747
+ t && t.$$ || P(`Cannot pass "${Ye(t)}" as a ${this.name}`), t.$$.ptr || P(`Cannot pass deleted object as a pointer of type ${this.name}`), !this.isConst && t.$$.ptrType.isConst && P(`Cannot convert argument of type ${t.$$.smartPtrType ? t.$$.smartPtrType.name : t.$$.ptrType.name} to parameter type ${this.name}`);
3793
3748
  var r = t.$$.ptrType.registeredClass;
3794
3749
  if (n = wt(t.$$.ptr, r, this.registeredClass), this.isSmartPointer) switch (t.$$.smartPtr === void 0 && P("Passing raw pointer to smart pointer is illegal"), this.sharingPolicy) {
3795
3750
  case 0:
@@ -3858,13 +3813,7 @@ var ri = ni, ii = {};
3858
3813
  }, Lt = (e, t) => {
3859
3814
  var n = [], r = {};
3860
3815
  function i(e) {
3861
- if (!r[e] && !M[e]) {
3862
- if (We[e]) {
3863
- We[e].forEach(i);
3864
- return;
3865
- }
3866
- n.push(e), r[e] = !0;
3867
- }
3816
+ r[e] || M[e] || (We[e] ? We[e].forEach(i) : (n.push(e), r[e] = !0));
3868
3817
  }
3869
3818
  throw t.forEach(i), new Ft(`${e}: ` + n.map(It).join([", "]));
3870
3819
  }, Rt = (e, t, n, r, i, a, o, s, c, l, u, d, f) => {
@@ -4483,11 +4432,7 @@ var ri = ni, ii = {};
4483
4432
  var br = J.__getTypeName, xr = J.free, Sr = J.malloc, Cr = J.__trap, wr = J._emscripten_stack_restore, Tr = J._emscripten_stack_alloc, Er = J.emscripten_stack_get_current, Dr = J.__cxa_decrement_exception_refcount, Or = J.__cxa_increment_exception_refcount, kr = J.__thrown_object_from_unwind_exception, Ar = J.__get_exception_message;
4484
4433
  r._ff_h264_cabac_tables = 1216265, r.getExceptionMessage = vr;
4485
4434
  function jr() {
4486
- if (se > 0) {
4487
- D = jr;
4488
- return;
4489
- }
4490
- if (ie(), se > 0) {
4435
+ if (se > 0 || (ie(), se > 0)) {
4491
4436
  D = jr;
4492
4437
  return;
4493
4438
  }
@@ -4729,7 +4674,7 @@ ti({ makeRemuxer: async ({ publicPath: e, length: t, bufferSize: n, audioStreamI
4729
4674
  }
4730
4675
  let n = await s.readKeyframe(c(e), t);
4731
4676
  if (!n.data?.byteLength) throw Error("empty keyframe data");
4732
- if ((!h || h.state === "closed") && (h = m()), h.state === "unconfigured") {
4677
+ if (h && h.state !== "closed" || (h = m()), h.state === "unconfigured") {
4733
4678
  if (!d) throw Error("decoder not configured");
4734
4679
  h.configure(d);
4735
4680
  }
@@ -4747,4 +4692,3 @@ ti({ makeRemuxer: async ({ publicPath: e, length: t, bufferSize: n, audioStreamI
4747
4692
  }
4748
4693
  };
4749
4694
  } }, { transport: globalThis });
4750
- //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libav-wasm",
3
- "version": "0.8.12",
3
+ "version": "0.8.13",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/banou26/libav-wasm.git"
@@ -16,7 +16,7 @@
16
16
  "dev-wasm-cmd": "nodemon -e cpp --exec \"npm run make-docker-debug\"",
17
17
  "dev-wasm": "concurrently \"nodemon -e cpp --exec \\\"npm run make-docker-debug\\\"\"",
18
18
  "build-worker": "vp build --config vite-worker.config.ts",
19
- "make-docker": "docker compose run --rm libav-wasm make",
19
+ "make-docker": "docker compose run --build --rm libav-wasm make",
20
20
  "docker-clean": "docker compose up --remove-orphans",
21
21
  "dev-web": "vp dev --port 1234",
22
22
  "vite-build": "vp build",
@@ -27,7 +27,7 @@
27
27
  "types": "tsc",
28
28
  "copy-wasm": "copyfiles -u 1 dist/libav.wasm dist/libav-jspi.wasm build && shx mv ./build/worker/index.d.ts ./build/worker.d.ts && shx rm -rf ./build/worker",
29
29
  "preview": "vp preview",
30
- "make-docker-debug": "docker compose run --rm libav-wasm make DEBUG=1",
30
+ "make-docker-debug": "docker compose run --build --rm libav-wasm make DEBUG=1",
31
31
  "fixtures": "node scripts/fixtures.mjs",
32
32
  "test": "playwright test",
33
33
  "test:large": "LIBAV_LARGE_FIXTURE=1 playwright test"
@@ -38,16 +38,16 @@
38
38
  "@types/emscripten": "^1.40.0",
39
39
  "concurrently": "^7.6.0",
40
40
  "copyfiles": "^2.4.1",
41
- "nodemon": "^2.0.22",
41
+ "nodemon": "^3.1.14",
42
42
  "osra": "^0.6.12",
43
43
  "p-queue": "^7.3.0",
44
44
  "shx": "^0.3.4",
45
45
  "typescript": "^7.0.2",
46
- "vite": "npm:@voidzero-dev/vite-plus-core@0.3.3",
47
- "vite-plus": "0.3.3"
46
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
47
+ "vite-plus": "1.4.0"
48
48
  },
49
49
  "overrides": {
50
- "vite": "npm:@voidzero-dev/vite-plus-core@0.3.3",
51
- "vitest": "4.1.11"
50
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
51
+ "vitest": "5.0.5"
52
52
  }
53
53
  }