Commit Graph
1 Commits
Author SHA1 Message Date
Miguel Ángel fdbc5dcaf7 fix(core): the playhead no longer jumps back when an audio clip starts (#4679)
* fix(core): the playhead no longer jumps back when an audio clip starts

While no Web Audio buffer plays, the transport clock follows an audio element, and each frame it re-picked the first in-window <audio> in page order. A sound effect that started during a voice line took the clock over, and since a clip starts late (seeked, asked to play, not yet producing sound) the playhead jumped back by that delay, 30 to 450 ms in real films, dragging every other track with it. The followed clip now keeps the clock while it plays. And audio may pull the playhead forward or hold it while it catches up (starting, seeking, buffering), but never push it back; a jump back past a hard sync, such as a native loop wrap, is ignored. The clock never runs ahead of its source, so media sync never chases it. Also: a playing element with a media error no longer leads the clock, and a speed change sets the clock's rate before the elements'.

* style(core): trim the handover fix's comments to what the code cannot say

* style(core): name the clock's no-rewind rule instead of commenting it

* style(core): format the clock

* test(core): pin the clock's hold while seeking and its skip of a failed clip

* fix(core): the playhead keeps its place on a speed change, a short loop or a failed clip

* fix(core): a late looping bed holds the playhead, and a clip with no source never leads it

* refactor(core): split the clock's behind-the-playhead rule into its own method

* fix(core): an audio clip with no source never leads or freezes the playhead
2026-09-28 18:58:29 +00:00