Clamp the skip fade to the outgoing track's remaining audio - #103
Merged
sanylax0 merged 1 commit intoJul 19, 2026
Merged
Conversation
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
approved these changes
Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, computeremaining = effectiveEndSeconds - position(audible time left, respecting silence trimming) andduration: min(Player.skipTransitionDurationSeconds, remaining)tobeginTransition, so the mix-out always completes within the audio that exists;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