voelin-stream: announce at most the 16 bits a TS6 server keeps

Probed against the TeamSpeak 6 dev server (6.0.0-beta13.1): `setupstream`
takes any bitrate and enforces none, but keeps it in 16 bits, so 100000
kbit/s is announced to the channel as 34464 and 4294967296 as 0. A stream
of more than 65.5 Mbit/s would have been announced as a small, wrong
number.

`proto::setup` now announces at most 65535 kbit/s
(`MAX_ANNOUNCED_BITRATE`); a 60 Mbit/s stream is announced as 60000, as
it is. The peers keep sending the real rate: nothing between them reads
the announcement. The probe and its results are in the protocol notes,
and the old "TeamSpeak caps streams at 10 Mbit/s" is corrected where the
code claimed it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
selikhovandClaude Opus 5.5 committed 2026-10-04 03:19:50 +03:00
1 parent b6f23827b3
commit 4fe7263553
3 files changed
+41 -4

No files matched your search

+2 -1
View File
@@ -139,7 +139,8 @@ pub enum H264Profile {
pub struct EncoderConfig {
/// Expected frame rate (rate control; timestamps come from the frames).
pub fps: u32,
/// Target bitrate in bits per second. TeamSpeak caps streams at 10 Mbit/s.
/// Target bitrate in bits per second (no limit; TeamSpeak 6 servers
/// enforce none, see `voelin_stream::proto::MAX_ANNOUNCED_BITRATE`).
pub bitrate_bps: u32,
/// Maximum frames between keyframes; `None` sends keyframes only at the
/// start and on request (PLI), like WebRTC.