Skip to content

fix: voice activity hangover overflow and rounding - #503

Merged
devopvoid merged 2 commits into
mainfrom
fix/voice-activity-hangover
Oct 31, 2026
Merged

devopvoid merged 2 commits into
mainfrom
fix/voice-activity-hangover

Conversation

@devopvoid

Copy link
Copy Markdown
Owner

Voice activity hangovers at Integer.MAX_VALUE milliseconds overflowed when native code added 9 before rounding to 10 ms chunks. Sub-millisecond portions were also truncated in both AudioTrack and PeerConnectionFactory, so 10.5 ms incorrectly became a 10 ms hangover instead of 20 ms.

Round partial milliseconds up in Java and use quotient/remainder rounding in native code, preserving the existing JNI signature. Add regression coverage for both listener paths at zero, 1 ns, exact 10/20 ms boundaries, 10 ms + 1 ns, 10.5 ms, the maximum accepted duration, and rejection just above that maximum.

The JNI library was rebuilt using the existing build configuration. The audio suite passed with 109 tests passing and 1 skipped. A full Maven verify was blocked during WebRTC configuration by filesystem restrictions; an additional full module test run encountered a peer-connection timeout and was stopped after stalling in video tests.

@devopvoid devopvoid changed the title Fix voice activity hangover overflow and rounding fix: voice activity hangover overflow and rounding Oct 31, 2026
@devopvoid
devopvoid merged commit 2dd25d2 into main Oct 31, 2026
22 checks passed
@devopvoid
devopvoid deleted the fix/voice-activity-hangover branch October 31, 2026 23:43
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.

1 participant