Skip to content

fix(producer): bound nested media by a host's data-duration when it has no data-end - #3965

Open
valeriangalliat wants to merge 1 commit into
heygen-com:mainfrom
valeriangalliat:fix/host-duration-bound
Open

valeriangalliat wants to merge 1 commit into
heygen-com:mainfrom
valeriangalliat:fix/host-duration-bound

Conversation

@valeriangalliat

Copy link
Copy Markdown
Contributor

What

In the render media planner, a composition host authored with data-duration but no data-end now closes at data-start + data-duration, so the audio and video nested inside it stop at the slot end.

Fixes #3964.

Why

resolveHostWindow bounded a host by data-end only, and compileTimingAttrs never stamps data-end on composition hosts, so a slot authored with data-duration was unbounded for the planner: a scene's audio kept playing over the next scene while the runtime (since #1662) already hid the slot's timed descendants at start + duration. Pixels and audio disagreed about where the slot ends; preview and render disagreed too, since the runtime media sync honours the authored host window.

How

renderMediaCollector.ts gains resolveHostEnd(host, hostStart): data-end wins, else hostStart + data-duration, else unbounded as before. hostStart is the already-resolved start, so id-ref hosts (data-start="intro") are bounded correctly too. Open-ended media inside a bounded host now closes with the host instead of staying end: 0.

One existing compile test (offsets template-wrapped media to the host start during compile) asserted the unbounded end — a 4s clip in a 2s slot ending at 6 — and now expects the slot end (4).

Test plan

  • Unit tests added/updated: new closes a host authored with data-duration but no data-end case (numeric and id-ref hosts, a clip starting after the slot is dropped); legacy-global and template-wrapped tests updated for the bounded end.
  • Manual testing performed: the reproduction at https://github.com/ArcadeHQ/hyperframes-repros/tree/patch/host-duration-bound renders −21 dB over the following scene on 0.8.40 and −91 dB (silence) with this change; frames unchanged.
  • Documentation updated (not applicable)

…as no data-end

The runtime hides a slot's descendants at data-start + data-duration, and
the compiler only stamps data-end on media tags, so a composition host
authored with data-duration was unbounded for the media planner: audio
and video nested in a shortened scene kept playing over the next scene.
The template-wrapped compile test asserted that unbounded end (a 4s clip
in a 2s slot ending at 6); it now expects the slot end.
valeriangalliat added a commit to ArcadeHQ/hyperframes-next that referenced this pull request Sep 15, 2026
valeriangalliat added a commit to ArcadeHQ/hyperframes-next that referenced this pull request Sep 15, 2026
valeriangalliat added a commit to ArcadeHQ/hyperframes-next that referenced this pull request Sep 15, 2026
valeriangalliat added a commit to ArcadeHQ/hyperframes-next that referenced this pull request Sep 15, 2026
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.

render: a composition slot's data-duration does not bound the media nested inside it (audio plays past the slot)

1 participant