From f05dc1f495461fec160aa5352af07edce08871c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E5=BD=AA?= Date: Fri, 24 Apr 2026 15:51:19 +0800 Subject: [PATCH] fix(export): address remaining PR #295 review threads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Include `resolvedWebcamVideoUrl` in the dependency arrays for `captureProjectThumbnail` and `handleExport` so thumbnail capture and export settings stay in sync when the webcam URL refreshes. - Clear `VideoMuxer.streamSink` before awaiting `closeIpcExportStream` in `finalize()` to close the race where a concurrent `destroy()` → `abortStream()` could try to close the same stream ID a second time. --- src/components/video-editor/VideoEditor.tsx | 2 ++ src/lib/exporter/muxer.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx index 919ed14e..794dba45 100644 --- a/src/components/video-editor/VideoEditor.tsx +++ b/src/components/video-editor/VideoEditor.tsx @@ -946,6 +946,7 @@ export default function VideoEditor() { cursorTelemetry, clipRegions, padding, + resolvedWebcamVideoUrl, shadowIntensity, showCursor, speedRegions, @@ -4356,6 +4357,7 @@ export default function VideoEditor() { padding, cropRegion, webcam, + resolvedWebcamVideoUrl, annotationRegions, autoCaptions, autoCaptionSettings, diff --git a/src/lib/exporter/muxer.ts b/src/lib/exporter/muxer.ts index cfb78ca9..54e551c9 100644 --- a/src/lib/exporter/muxer.ts +++ b/src/lib/exporter/muxer.ts @@ -172,8 +172,11 @@ export class VideoMuxer { if (!sink) { throw new Error("Stream target closed before finalization"); } - const closeResult = await closeIpcExportStream(sink.streamId); + // Clear streamSink before awaiting close so a concurrent destroy()→ + // abortStream() short-circuits on `!this.streamSink` instead of racing + // us for the same streamId. this.streamSink = null; + const closeResult = await closeIpcExportStream(sink.streamId); return { mode: "stream", tempFilePath: closeResult.tempPath,