Skip to content

🎥 Make videos programmatically with React

Update compositor.ts

Jonny Burgerbbeab2375a05
diff --git a/packages/renderer/src/compositor/compositor.ts b/packages/renderer/src/compositor/compositor.ts
index fe4ef31560..880dbad841 100644
--- a/packages/renderer/src/compositor/compositor.ts
+++ b/packages/renderer/src/compositor/compositor.ts
@@ -118,13 +118,13 @@ export const startCompositor = <T extends keyof CompositorCommand>(
return;
}
- const data = outputBuffer.slice(
+ const data = outputBuffer.subarray(
separatorIndex + 1,
separatorIndex + 1 + Number(lengthString)
);
onMessage(nonceString, data);
- outputBuffer = outputBuffer.slice(separatorIndex + separator.length);
+ outputBuffer = outputBuffer.subarray(separatorIndex + separator.length);
processInput();
};
@@ -167,7 +167,7 @@ export const startCompositor = <T extends keyof CompositorCommand>(
},
};
// TODO: Should have a way to error out a single task
- child.stdin.write(JSON.stringify({command: composed}) + '\n');
+ child.stdin.write(JSON.stringify(composed) + '\n');
waiters.set(nonce, {
resolve: (data: Buffer) => {
resolve(data);