Repository navigation
Clamp out-of-range output_delay_ms - #176
Merged
Merged
Conversation
1 of 9 tasks
maximmaxim345
added a commit
to Sendspin/aiosendspin
that referenced
this pull request
Oct 2, 2026
# What does this implement/fix? <!-- Quick description and explanation of changes. --> The client dropped a `set_output_delay` command with `output_delay_ms` outside 0-5000, since parsing failed before the client's own clamp was reached. The value is now clamped while parsing, as the spec requires, and the clamped delay is applied. The server still rejects out-of-range values in commands it sends. **Related issue or spec PR (if applicable):** - Sendspin/spec#176 ## Types of changes <!-- Tick exactly one box. CI (.github/workflows/pr-labels.yaml) applies the matching label, and the release notes use it to sort this change. --> - [x] Bugfix (non-breaking change which fixes an issue): `bugfix` - [ ] New feature (non-breaking change which adds functionality): `new-feature` - [ ] Enhancement to an existing feature: `enhancement` - [ ] Breaking change (changes the public API or the protocol in a way that is not backwards compatible): `breaking-change` - [ ] Refactor (no behavior change): `refactor` - [ ] Documentation only: `documentation` - [ ] Maintenance / chore: `maintenance` - [ ] CI / workflow change: `ci` - [ ] Dependencies bump: `dependencies`
1 task done
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.
The spec documents the
output_delay_msrange as 0-5000 in both theclient/stateplayer object and theset_output_delayparameters, but never says what a client does with a value outside it, so SDK behavior diverges: some obey the range, some clamp, and one flips a negative value's sign, which is audible. This adds one sentence to the "Output delay" paragraph requiring clients to clamp the value into 0-5000, so a bad value degrades to the nearest valid delay instead of disrupting playback. The issue also proposed a SHOULD-log clause, left out because the spec has no logging requirements anywhere and logging is neither observable on the wire nor testable by a conformance suite.Closes #93