8000 fix(preview): keep every covering cam's decoder hot to stop pill-start flip flicker by johannboehme · Pull Request #39 · johannboehme/tk-1 · GitHub
[go: up one dir, main page]

Skip to content

fix(preview): keep every covering cam's decoder hot to stop pill-start flip flicker - #39

Merged
johannboehme merged 1 commit into
mainfrom
claude/fix-pill-start-flip
May 6, 2026
Merged

johannboehme merged 1 commit into
mainfrom
claude/fix-pill-start-flip

Conversation

@johannboehme
Copy link
Copy Markdown
Owner

Summary

PR #38 introduced a regression: the video pool now pauses any cam not in the descriptor's active layer, which means inactive cams' decoders go cold. Cuts that later switch to one of them force a fresh play() + seek, and Chrome occasionally ships the first frame after a fresh seek upside-down on the WebGPU `copyExternalImageToTexture` path. User saw every pill start flickering between flipped and right-side-up for the first few frames.

Fix: derive the pool's per-cam targets from `snapshot.pills` directly. Every cam whose pill covers the current `timelineT` gets a target, not just the cuts-resolved active cam. All decoders stay hot and a cut becomes a no-op for the decoder. Source-trim is still pill-aware so the duplicate-pill source-frame fix from #38 is preserved.

Test plan

🤖 Generated with Claude Code

…t flip flicker

Previous PR (#38) tightened the video pool so cams without a layer in
the descriptor get paused. That kept the GPU decoder cold for any cam
that wasn't the active one — and as soon as a cut switched to one of
those cams, Chrome had to re-warm + re-seek the decoder. Chrome's
copyExternalImageToTexture path occasionally lands the first frame
after such a (re-)seek upside-down, which presented as every pill
flickering between flipped and right-side-up for the first few
frames.

Switch the target source: instead of reading the descriptor's single
active layer, iterate `snapshot.pills` and put EVERY cam whose pill
covers the current `tTimeline` into the targets map. The pool keeps
all decoders running on their pill-correct source-time, the cut
switch becomes a no-op for the decoder, and the upload picks up an
already-hot stream — so the first-frame-after-seek path never fires.

Source-trim semantics are still pill-aware (each cam's covering pill
contributes its own `sourceInS/Out` window), so duplicate-source
pills with distinct trims still seek to the right frame for that
specific occurrence — the bug 1 fix from #38 is preserved.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@johannboehme
johannboehme merged commit 8207704 into main May 6, 2026
1 check passed
@johannboehme
johannboehme deleted the claude/fix-pill-start-flip branch May 6, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0