8000 fix(triage): flip cam-preview source-time sign so pre-roll maps forward by johannboehme · Pull Request #41 · johannboehme/tk-1 · GitHub
[go: up one dir, main page]

Skip to content

fix(triage): flip cam-preview source-time sign so pre-rol 8000 l maps forward - #41

Merged
johannboehme merged 1 commit into
mainfrom
claude/beautiful-brattain-35993e
May 9, 2026
Merged

johannboehme merged 1 commit into
mainfrom
claude/beautiful-brattain-35993e

Conversation

@johannboehme
Copy link
Copy Markdown
Owner

Summary

  • CamPreview.tsx and chunk-thumbnails.ts had the wrong sign on the master→source-time formula. Positive sync.offsetMs (cam started before master t=0 — typical phone pre-roll) caused the preview to pause for the entire pre-roll window, then start the video from its silent prelude, off-by-offset for the rest of the song. Maria-José case: 740 s audio + 938 s video, matcher returned +193 000 ms, preview frozen for 3:13 then played from time 0 — exactly matching the user's report.
  • Switched both call sites to camSourceTimeS({masterStartS: -syncOffsetMs/1000}) so triage and arrange share the same sign convention the editor and renderer already use.
  • Added decideCamPreviewAction() as a pure helper (with regression test for the 193-s case) plus an explicit play() resume when the master crosses sourceT=0 from below — previously the per-tick pause() left the element frozen on the first post-anchor frame.

Test plan

  • bun run vitest --project unit — 961 pass (15 new in cam-preview-sync.test.ts + cam-time + diagnostics)
  • Local repro with the reporter's maria_josee.mp3 + VID_20260509_104631_00_229.mp4: preview is in sync from t=0, no more 3:13 freeze
  • Reporter's brother to retry with the new diagnostic banner from feat(jobs): rich sync-failure diagnostic report behind banner toggle #40 — separate failure path on his Chromium, addressed via the diagnostic copy-button there

🤖 Generated with Claude Code

…tMs (pre-roll) maps forward

`CamPreview` and `chunk-thumbnails` both computed `sourceT = masterT − syncOffsetMs/1000`,
but the rest of the pipeline (`local/timing/cam-time.ts`, `editor/types.ts:clipRangeS`,
`jobs.ts:masterStartS = -(algoMs+userMs)/1000`) treats positive `syncOffsetMs` as
"cam started BEFORE master t=0 (pre-roll)". With the wrong sign, a video whose audio
matched ~193 s into the recording showed the preview frozen for the entire pre-roll
window and then started playing from the cam's silent prelude, off by 193 s for the
rest of the song. Flipped to `camSourceTimeS(masterT, {masterStartS: -syncOffsetMs/1000})`
so triage and arrange use the same convention as render.

Also: when the master is playing and the cam crosses sourceT=0 from below (the typical
pre-roll handoff), explicitly call `play()` again — the previous code paused on every
negative tick but never resumed, leaving the element frozen on the first post-anchor
frame.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@johannboehme
johannboehme merged commit c2f7f2f into main May 9, 2026
1 check passed
@johannboehme
johannboehme deleted the claude/beautiful-brattain-35993e branch May 9, 2026 14:58
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