Repository navigation
fix(studio-server): a video with a codec nobody listed gets a playable preview copy - #7356
Conversation
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · head 60e2cab0
- blocker: the PR body has no
fails without the fix:line naming a test that fails on main. This lane requires one on every fix PR. The body is only a## Sizesection. Add the line (for example,fails without the fix: treats a codec nobody listed as browser-hostile, so its file gets a playable copy) along with a short what/why. That is the only blocker.
The code itself looks right to me. Inverting hostileCodecEntry to an allowlist (h264, vp8, plus the MIME-checked vp9/av1) keeps the Object.hasOwn guard. The probe cache is in memory and keyed by mtime, so stale facts don't outlive the process. One side effect to confirm is intended: publishProxyBake (cli/src/utils/publishProxyBake.ts:97) will now bake proxies for unlisted codecs at publish.
Scope
Read the diff, hostileCodecEntry and its callers (codecFactsFor, shouldPrewarmProxy), scanProjectMedia, the probe cache, and the runtime consumers of browserHostile. CI CI/CodeQL/Windows render verification were still running at review time.
|
Added the 'fails without the fix:' line and the what/why to the body (the first body write had lost them). Yes, the publish bake now also covers unlisted codecs; that is intended and stated in the body. |
Edit accuracy: accurate 267 (base branch 267), smooth 110 of thoseThe gate passes. Quarantined, measured but not gated (8)
Unstable (1)
|
There was a problem hiding this comment.
Verdict: APPROVE · 1 resolved, 0 open, 0 new · 60e2cab0 → 60e2cab0 (body-only change). The fails without the fix: line names two tests; both assert browserHostile: true for an unlisted codec, where main returns false, so both fail on main. The publish-bake side effect is stated as intended.
What changed
A video whose codec the preview server has no entry for now counts as browser-hostile and gets a playable preview copy, unless its codec is on a short list browsers decode everywhere (H.264 and VP8). Before, the table listed the codecs to convert and everything else was assumed to play, so a file with a codec nobody had listed showed a blank tile until someone added its name. VP9 and AV1 keep their existing entries: copied only when a browser asks.
Why
Each blank-tile report so far (MPEG-4, MJPEG, MPEG-2, DNxHD) was the same missing line. The rule now fails safe: an unknown codec costs one background transcode, never a blank preview. Publishing bakes a proxy for an unlisted codec too, as it does for the listed ones; that is intended.
What I measured
fails without the fix: packages/studio-server/src/helpers/mediaCodecMap.test.ts "treats a codec nobody listed as browser-hostile, so its file gets a playable copy" and "reads a codec named after an Object.prototype key as an unlisted codec" (both red on main, green here; run on Linux).
What I did NOT exercise
browserHostileandshouldPrewarmProxy, so they follow the new rule; only studio-server's tests ran.Size
About 50 changed lines in 2 files: one rule inverted in one function and its tests. Nothing else can carry it.
Size: a lone urgent fix. Paying people see blank video cards for codecs nobody listed, and no open PR in this area can carry it.