fix(producer): decode percent-encoded video src in HDR pre-extract#2759
Open
vanceingalls wants to merge 1 commit into
Open
fix(producer): decode percent-encoded video src in HDR pre-extract#2759vanceingalls wants to merge 1 commit into
vanceingalls wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes symptom (c) of PRINFRA-349 (non-ASCII / CJK media path breaks HDR render).
Root cause
HDR pre-extraction resolved a
<video>source to a filesystem path by naively joining the rawsrcattribute:But
v.srcis the compiled DOM's URL attribute, so a source named视频1.mp4arrives percent-encoded as%E8%A7%86%E9%A2%911.mp4. That encoded string was passed straight to ffmpeg as a path →Error opening input file <project>/%E8%A7%86%E9%A2%911.mp4: No such file or directory. The SDR extractor never hit this because it resolves throughresolveProjectRelativeSrc, which triesdecodeUrlPathVariantsagainst the filesystem; the HDR planner had its own hand-rolled join that skipped the decode.Fix
planHdrResourcesnow resolves via the sharedresolveProjectRelativeSrc— the exact resolver the SDR path uses — so the encoded src decodes back to the real on-disk filename (and query strings, origin-root URLs, and..traversal now resolve identically across the two paths). Removed the redundant injectedexistsSyncparam.Test
planHdrResourcestests: a percent-encoded CJK src resolves to the decoded on-disk path; an ASCII src is unchanged. (captureHdrResources.test.ts, 5/5)tsc/oxlint/oxfmtclean.Scope note
The ticket aggregates three symptoms under "one root cause," but (c) is independent of (a)/(b): it's a cross-platform URL-vs-filesystem decode bug in the producer (reproduces on macOS, per the report), not Windows-native path handling. (a) Windows init access-violation and (b) Windows init EIO are a separate Windows-native theme — see the ticket comment for triage; they need a Windows repro to fix safely and aren't touched here.
Related: PRINFRA-349
🤖 Generated with Claude Code