Repository navigation
fix(core): a playing preview clip keeps its source until it pauses before a new copy size - #7243
miguel-heygen wants to merge 2 commits into
Conversation
…fore a new copy size
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 0 important · 1 nit · head 385b0719
Scope
Read the full diff, plus every keepSized/requestBox caller and the pendingUpgrades lifecycle. A wish that is superseded or dropped while waiting (dropUnneededCopy, retryPreviewCopies, a src change) turns wanted() false, and the waiter cleans up without swapping. Locally mediaProxy.test.ts passes 76/76. With main's mediaProxy.ts both new tests fail (expected '2436x4096' to be '1218x2048'), so the fails without the fix: line holds. Two swaps stay out of scope: the error-retry swap (the body says so) and a user-set quality change through applyPreviewQuality. Comments is green; the rest of CI was still running.
— Genesis V2 (Lane B)
|
Took the nit (4abccc7): the put-back branch of keepSized now waits once per clip (a WeakSet of clips with a restore pending), so a panel drag during playback no longer stacks waiters. fails without the fix: mediaProxy.test.ts › waits once for a playing clip's light copy to be put back, however often its size is asked (3 pause listeners instead of 1 with the guard removed). Whole file: 77 pass. |
|
Closing: a trigger run of 20 plays (size and quality changes mid-play, 5 each, with and without this change) produced no in-play source swaps either way, and waiting while playing did not differ. The Windows choppiness report stays open and gets a new fix if it recurs with a trigger we can reproduce. |
…view to heygen-com#7250 Adopts heygen-com#7310 (MPEG-4 Part 2 / MJPEG get browser-playable copies), heygen-com#7316 (check_report counts the copies a check waited for) and heygen-com#7317 (render reads a composition src like the preview and refuses paths outside the project). Defers heygen-com#7309 (needs heygen-com#6912); heygen-com#7314 does not apply. PR axis advances to heygen-com#7250 (heygen-com#7243 closed unmerged, heygen-com#7249 open and pinned as monitored; monitored 96->97). Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
A preview clip that is playing at the playhead no longer has its source swapped for another size or quality of its lighter copy. The swap waits until the clip pauses, seeks, ends or leaves its window.
Why
Setting a video element's
srcempties it: it loads again from the start of the new file and shows "waiting" until it can play. The preview does this when the shown size of a clip changes (a larger copy to take, a light copy no longer needed), so a clip that is on screen and playing can stutter or freeze for a moment each time its size class changes. People on Windows reported choppy preview playback; this is one cause, a swap under a playing clip.Related work
Refs the choppy-preview reports. Not covered here: the swap to a decodable copy after a player error (the desktop app's own
?hf-proxy=autoretry), which has to show something else while it loads; and a clip that fails to load for other reasons.How
packages/core/src/runtime/mediaProxy.ts:whenNotPlayingHere(el, wanted, apply)runsapplynow when the clip is not playing at the playhead, else on its nextpause,seeking,endedoremptiedor a 250 ms check, and does nothing ifwanted()turned false meanwhile.requestBoxuses it beforeloadProxy, andkeepSizeduses it beforerestoreOriginal. A pending upgrade stays marked until the swap runs, so no second request is made for the same size.Size
Small on purpose: one helper in one file and its test, a lone fix no other open change carries.
Test plan
expected '2436x4096' to be '1218x2048') and pass with it; the whole file passes (76 tests), andoxfmt --check,oxlintand core'stsc --noEmitare clean.What I did not do