mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-24 23:05:49 +00:00
fix: address final export pipeline review follow-ups
This commit is contained in:
@@ -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:\/\//, "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user