@remotion/media 4.0.515 → 4.0.516

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.
Files changed (2) hide show
  1. package/dist/esm/index.mjs +15 -7
  2. package/package.json +4 -4
@@ -4089,6 +4089,9 @@ var fixFloatingPoint = (value) => {
4089
4089
  }
4090
4090
  return value;
4091
4091
  };
4092
+ var clampToS16 = (value) => {
4093
+ return Math.max(-32768, Math.min(32767, value));
4094
+ };
4092
4095
  var resampleAudioData = ({
4093
4096
  srcNumberOfChannels,
4094
4097
  sourceChannels,
@@ -4149,13 +4152,14 @@ var resampleAudioData = ({
4149
4152
  const l = getSourceValues(start, end, 0);
4150
4153
  const r = getSourceValues(start, end, 1);
4151
4154
  const c = getSourceValues(start, end, 2);
4152
- const sl = getSourceValues(start, end, 3);
4153
- const sr = getSourceValues(start, end, 4);
4155
+ const sl = getSourceValues(start, end, 4);
4156
+ const sr = getSourceValues(start, end, 5);
4154
4157
  const sq = Math.sqrt(1 / 2);
4155
- const l2 = l + sq * (c + sl);
4156
- const r2 = r + sq * (c + sr);
4157
- destination[newFrameIndex * 2 + 0] = l2;
4158
- destination[newFrameIndex * 2 + 1] = r2;
4158
+ const norm = 1 / (1 + sq + sq);
4159
+ const l2 = (l + sq * (c + sl)) * norm;
4160
+ const r2 = (r + sq * (c + sr)) * norm;
4161
+ destination[newFrameIndex * 2 + 0] = clampToS16(l2);
4162
+ destination[newFrameIndex * 2 + 1] = clampToS16(r2);
4159
4163
  } else {
4160
4164
  for (let i = 0;i < srcNumberOfChannels; i++) {
4161
4165
  destination[newFrameIndex * TARGET_NUMBER_OF_CHANNELS + i] = getSourceValues(start, end, i);
@@ -4785,7 +4789,11 @@ var addBroadcastChannelListener = () => {
4785
4789
  audio,
4786
4790
  durationInSeconds: durationInSeconds ?? null
4787
4791
  };
4788
- window.remotion_broadcastChannel.postMessage(response);
4792
+ try {
4793
+ window.remotion_broadcastChannel.postMessage(response);
4794
+ } finally {
4795
+ imageBitmap?.close();
4796
+ }
4789
4797
  } catch (error) {
4790
4798
  const response = {
4791
4799
  type: "response-error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/media",
3
- "version": "4.0.515",
3
+ "version": "4.0.516",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "module": "dist/esm/index.mjs",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "mediabunny": "1.55.1",
26
- "remotion": "4.0.515",
26
+ "remotion": "4.0.516",
27
27
  "zod": "4.4.3"
28
28
  },
29
29
  "peerDependencies": {
@@ -31,8 +31,8 @@
31
31
  "react-dom": ">=16.8.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@remotion/eslint-config-internal": "4.0.515",
35
- "@remotion/player": "4.0.515",
34
+ "@remotion/eslint-config-internal": "4.0.516",
35
+ "@remotion/player": "4.0.516",
36
36
  "@vitest/browser-webdriverio": "4.0.9",
37
37
  "eslint": "9.19.0",
38
38
  "react": "19.2.3",