mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-25 23:35:43 +00:00
fix(recording): keep embedded audio fallbacks safe
This commit is contained in:
@@ -512,8 +512,7 @@ export async function getCompanionAudioFallbackInfo(videoPath: string) {
|
||||
new Set(
|
||||
companionCandidates.flatMap((candidate) =>
|
||||
candidate.usablePaths.filter(
|
||||
(companionPath) =>
|
||||
companionPath === candidate.micPath || companionPath === candidate.systemPath,
|
||||
(companionPath) => companionPath === candidate.micPath,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -82,11 +82,11 @@ async function loadSavedProjectMediaPaths() {
|
||||
editor?: { webcam?: { sourcePath?: unknown } };
|
||||
}>(await fs.readFile(projectPath, "utf-8"));
|
||||
} catch (error) {
|
||||
console.warn("[prune] Skipping unreadable project while pruning recordings", {
|
||||
console.warn("[prune] Aborting recording prune because a saved project is unreadable", {
|
||||
projectPath,
|
||||
error,
|
||||
});
|
||||
return;
|
||||
throw error;
|
||||
}
|
||||
const candidatePaths = [
|
||||
rawProject.videoPath,
|
||||
|
||||
@@ -14,8 +14,8 @@ type OfflineRenderTestHarness = AudioProcessor & {
|
||||
sourceAudioFallbackPaths: string[],
|
||||
sourceAudioFallbackStartDelayMsByPath?: Record<string, number>,
|
||||
): Promise<{
|
||||
mainBuffer: AudioBuffer | null;
|
||||
companionEntries: Array<{ buffer: AudioBuffer; startDelaySec: number }>;
|
||||
mainBufferEntry: { buffer: AudioBuffer; gain: number } | null;
|
||||
companionEntries: Array<{ buffer: AudioBuffer; startDelaySec: number; gain: number }>;
|
||||
}>;
|
||||
renderAndMuxOfflineAudio(
|
||||
videoUrl: string,
|
||||
@@ -55,7 +55,8 @@ describe("AudioProcessor offline render preparation", () => {
|
||||
["/tmp/recording.mp4", "/tmp/recording.mic.wav"],
|
||||
);
|
||||
|
||||
expect(prepared.mainBuffer).toBe(mainBuffer);
|
||||
expect(prepared.mainBufferEntry?.buffer).toBe(mainBuffer);
|
||||
expect(prepared.mainBufferEntry?.gain).toBe(1);
|
||||
expect(prepared.companionEntries).toHaveLength(1);
|
||||
expect(prepared.companionEntries[0]?.buffer).toBe(micBuffer);
|
||||
expect(decodeAudioFromUrl).toHaveBeenCalledWith("file:///tmp/recording.mp4");
|
||||
|
||||
Reference in New Issue
Block a user