From 6dbdac81181371c75646ea3f8f5254192d29db3c Mon Sep 17 00:00:00 2001 From: James Date: Thu, 14 May 2026 23:49:12 +0000 Subject: [PATCH] fix(producer): normalize default-format check + carry no-audio rationale to mp4-h265-sdr fixture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address @vanceingalls review on #851: 1. validateMetadata's codec/format check read 'rc.codec !== undefined && rc.format !== undefined && rc.format !== "mp4"'. The behavior was correct (omitted format defaults to mp4 downstream so codec is legal) but relied on the reader knowing that default. Normalize 'effectiveFormat = rc.format ?? "mp4"' before the comparison so the intent reads directly. 2. The mp4-h264-sdr sibling carries inline rationale for the no-audio choice (AAC frame quantization extends container.duration past nb_frames/fps and trips the harness PSNR sampler) and the chunk-seam mapping (crossfade window 0.9-1.1s straddles frame 30). mp4-h265-sdr stripped both. Carry them back so the two fixtures stay parallel. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- packages/producer/src/regression-harness.ts | 9 ++++++++- .../tests/distributed/mp4-h265-sdr/src/index.html | 12 ++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/producer/src/regression-harness.ts b/packages/producer/src/regression-harness.ts index a540fc31e..776d14145 100644 --- a/packages/producer/src/regression-harness.ts +++ b/packages/producer/src/regression-harness.ts @@ -266,7 +266,14 @@ function validateMetadata(meta: unknown): TestMetadata { "meta.json: 'renderConfig.codec' must be 'h264' or 'h265' (or omit for the format's default)", ); } - if (rc.codec !== undefined && rc.format !== undefined && rc.format !== "mp4") { + // Normalize the implicit default before comparing so a fixture that + // omits `format` (which defaults to "mp4" everywhere downstream) doesn't + // get accidentally treated as "format is missing, so codec is illegal." + // The previous formulation `rc.format !== undefined && rc.format !== "mp4"` + // worked but relied on the reader knowing the default; this reads the + // intent more directly. + const effectiveFormat = (rc.format as string | undefined) ?? "mp4"; + if (rc.codec !== undefined && effectiveFormat !== "mp4") { throw new Error( `meta.json: 'renderConfig.codec' is only valid for format='mp4' (got format=${JSON.stringify( rc.format, diff --git a/packages/producer/tests/distributed/mp4-h265-sdr/src/index.html b/packages/producer/tests/distributed/mp4-h265-sdr/src/index.html index 710a6ead3..ce638a515 100644 --- a/packages/producer/tests/distributed/mp4-h265-sdr/src/index.html +++ b/packages/producer/tests/distributed/mp4-h265-sdr/src/index.html @@ -84,9 +84,21 @@ +