Skip to content

Commit d08d972

Browse files
committed
fix(cli): pass a sound file to ffprobe as a file, on every platform
ffprobe treated a name starting with a dash as an option because the argument list never ended the flags. The path check compared a Windows drive path to a POSIX string, and a new timeline comment raised that file's comment share.
1 parent 3bbf0ca commit d08d972

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

‎packages/cli/src/audio/analysis/decode.ts‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,18 @@ function requiredBinary(name: "ffmpeg" | "ffprobe"): string {
2121
export async function probeAudio(file: string): Promise<AudioStreamInfo | null> {
2222
const { stdout } = await run(
2323
requiredBinary("ffprobe"),
24-
["-v", "error", "-select_streams", "a:0", "-show_streams", "-show_format", "-of", "json", file],
24+
[
25+
"-v",
26+
"error",
27+
"-select_streams",
28+
"a:0",
29+
"-show_streams",
30+
"-show_format",
31+
"-of",
32+
"json",
33+
"--",
34+
file,
35+
],
2536
{ maxBuffer: 8 * 1024 * 1024, windowsHide: true },
2637
);
2738
const parsed = JSON.parse(stdout) as {

‎packages/cli/src/audio/analysis/targets.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { resolve } from "node:path";
12
import { describe, expect, it } from "vitest";
23
import type { ProjectTimeline, TimelineRow } from "../../timeline/describeProject.js";
34
import { fileTime, filmTargets, filmTime, type Placement } from "./targets.js";
@@ -114,7 +115,7 @@ describe("filmTargets", () => {
114115

115116
it("resolves a source against the file that declares the clip, and keeps its local data-start", () => {
116117
const [fast] = filmTargets("/p", timeline, { by: "element", ref: "#fast" });
117-
expect(fast!.path).toBe("/p/shared/riser.wav");
118+
expect(fast!.path).toBe(resolve("/p/shared/riser.wav"));
118119
expect(fast!.placement).toEqual({
119120
start: 8,
120121
end: 10,

‎packages/cli/src/timeline/describeProject.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export interface TimelineRow extends ClipFact {
7171
children: RowPointer[];
7272
/** Signed frames from its `data-sync-origin` partner (+ = late); `null` unpaired or rates differ. */
7373
syncOffsetFrames: number | null;
74-
/** Seconds into the media file where the played part begins; `null` for a row that is not media. */
7574
mediaStart: number | null;
7675
}
7776

0 commit comments

Comments
 (0)