fix: address final export pipeline review follow-ups

This commit is contained in:
webadderall
2026-04-17 00:41:32 +10:00
parent aa27e7cbd1
commit e6ce742f58
2 changed files with 9 additions and 4 deletions
+5 -1
View File
@@ -47,13 +47,17 @@ export class ForwardFrameSource {
const url = new URL(resourceUrl);
let filePath = decodeURIComponent(url.pathname);
if (url.host && url.host !== "localhost") {
return `//${url.host}${filePath}`;
return `\\\\${url.host}${filePath.replace(/\//g, "\\")}`;
}
if (/^\/[A-Za-z]:/.test(filePath)) {
filePath = filePath.slice(1);
}
return filePath;
} catch {
const uncMatch = resourceUrl.match(/^file:\/\/([^/]+)(\/.*)$/i);
if (uncMatch && uncMatch[1].toLowerCase() !== "localhost") {
return `\\\\${uncMatch[1]}${decodeURIComponent(uncMatch[2]).replace(/\//g, "\\")}`;
}
return resourceUrl.replace(/^file:\/\//, "");
}
}
+4 -3
View File
@@ -565,7 +565,7 @@ export class VideoExporter {
if (this.cancelled || !this.nativeExportSessionId) return;
const buffer = new ArrayBuffer(chunk.byteLength);
chunk.copyTo(buffer);
const writePromise = (this.nativePendingWrite = this.nativePendingWrite
const writePromise = this.nativePendingWrite
.then(async () => {
const writeResult = await window.electronAPI.nativeVideoExportWriteFrame(
sessionId,
@@ -586,7 +586,8 @@ export class VideoExporter {
this.nativeWriteError =
error instanceof Error ? error : new Error(String(error));
}
}));
});
this.nativePendingWrite = writePromise;
this.trackNativeWritePromise(writePromise);
},
error: (e) => {
@@ -842,7 +843,7 @@ export class VideoExporter {
return;
}
await oldestWritePromise;
await this.awaitWithFinalizationTimeout(oldestWritePromise, "native frame write");
if (this.nativeWriteError) {
throw this.nativeWriteError;