Skip to content

Clamp the skip fade to the outgoing track's remaining audio - #103

Merged
sanylax0 merged 1 commit into
mainfrom
claude/repo-review-improvements-yvk3t7-skip-fade-clamp-2
Jul 19, 2026
Merged

sanylax0 merged 1 commit into
mainfrom
claude/repo-review-improvements-yvk3t7-skip-fade-clamp-2

Conversation

@sanylax2

Copy link
Copy Markdown
Collaborator

What

Replaces #102 (which conflicted with the smooth-skip refactor merged in #101; branch protection blocks force-pushes, so this is the rebased branch under a new name — close #102).

Fixes the audible hard cut when skipping near the end of a short track (reported on the first track of a playlist at ~26 s): the fixed 5 s skip blend never checked how much outgoing audio remains, so the outgoing file drained mid-fade at ~30% gain — an instant drop inside the blend.

How

Ported onto #101's design: in next(), after the deck is materialized, compute remaining = effectiveEndSeconds - position (audible time left, respecting silence trimming) and

  • pass duration: min(Player.skipTransitionDurationSeconds, remaining) to beginTransition, so the mix-out always completes within the audio that exists;
  • hard-advance instead when under 1 s remains — too little to read as a blend.

All other #101 behavior (skip-from-paused materialization, no refund on skip blends, double-tap guard) is untouched.

Testing

On device: skip the first track of the repro playlist at ~26 s — the fade should complete cleanly with no drop; mid-track skips still get the full 5 s.

🤖 Generated with Claude Code

https://claude.ai/code/session_013TJoWkqg8bzkGdzxWhWjWP


Generated by Claude Code

A fixed 5 s skip blend with less than 5 s of outgoing audio left ends
in the file draining mid-fade at ~30% gain — an audible hard cut on
short tracks and hot endings (reported skipping the first track of a
playlist at ~26 s). Clamp the fade to the remaining audible time and
fall back to a hard cut when under a second remains.
@sanylax0
sanylax0 merged commit bae3bbc into main Jul 19, 2026
1 of 4 checks passed
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.

3 participants