🎥 Make videos programmatically with React
`@remotion/renderer`: Shut down compositor when extractAudio fails (#9472)
Santhi Prakash13a7ecdc2e59
diff --git a/packages/renderer/src/extract-audio.ts b/packages/renderer/src/extract-audio.tsindex e6c09a6ecd..b9489abdc8 100644--- a/packages/renderer/src/extract-audio.ts+++ b/packages/renderer/src/extract-audio.ts@@ -18,10 +18,27 @@ export const extractAudio = async (options: {binariesDirectory: options.binariesDirectory ?? null,extraThreads: 0,});- await compositor.executeCommand('ExtractAudio', {- input_path: options.videoSource,- output_path: options.audioOutput,- });- await compositor.finishCommands();- await compositor.waitForDone();++ let executeError: Error | undefined;++ try {+ await compositor.executeCommand('ExtractAudio', {+ input_path: options.videoSource,+ output_path: options.audioOutput,+ });+ } catch (error) {+ executeError = error as Error;+ }++ try {+ await compositor.shutDownOrKill();+ } catch (shutdownError) {+ if (!executeError) {+ throw shutdownError;+ }+ }++ if (executeError) {+ throw executeError;+ }};