Skip to content

Clamp out-of-range output_delay_ms - #176

Merged
kahrendt merged 1 commit into
mainfrom
fix/clamp-output-delay
Aug 28, 2026
Merged

kahrendt merged 1 commit into
mainfrom
fix/clamp-output-delay

Conversation

@maximmaxim345

Copy link
Copy Markdown
Member

The spec documents the output_delay_ms range as 0-5000 in both the client/state player object and the set_output_delay parameters, 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

@kahrendt kahrendt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kahrendt
kahrendt merged commit 4a08989 into main Aug 28, 2026
1 check passed
@kahrendt
kahrendt deleted the fix/clamp-output-delay branch August 28, 2026 14:27
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`
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.

Static delay: specify what a client does with an out-of-range static_delay_ms

2 participants