mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-11-10 07:53:57 +00:00
When a recorded audio file is significantly shorter than the captured video, getAudioSyncAdjustment previously returned mode "delay" for any delta above 3% relative AND 1500ms absolute, prepending leading silence equal to the full duration delta via `adelay=N|N`. For long recordings where the duration delta can grow to tens of seconds or minutes, issue #252 reports up to 2 minutes of pure silence at the start of a 10-min Windows recording before audio cuts in mid-clip. Cap the delay branch at 15s. Above the cap, return a new "pad" mode that anchors the audio at the start and emits `apad=pad_dur=...` so the audio plays from t=0 and trailing silence fills the rest of the video duration. Users perceive this as "audio recording cut out before video ended" rather than "audio is shifted late vs video", which is the clearer failure mode when the underlying capture produced a short audio file. Owner's existing assertion that 10s short audio gets delay (test #3 in filters.test.ts: getAudioSyncAdjustment(120, 110) -> delay 10000) is preserved unchanged because 10000 <= 15000. Refs: #252 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>