mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
fix(screen-share): keep the announced viewer count in step with the roster
Two smaller gaps left over from removing the inline avatars. The announced viewerCount summed the viewer entry ids and the native viewer ids, while the roster silently dropped ids whose participant had vanished from the entry map. A client that disappears without passing through the leave path therefore inflated the count for as long as the stream lived. Prune those ids, and derive the count in the same call that builds the roster so the two can no longer disagree. The legacy inline-avatar path capped each entry at 128 KiB but placed no bound on the roster total, which still allowed 64 x 128 KiB in a single broadcast. Bound the total as well; entries past the budget fall back to the client-side member lookup like any other viewer without an avatar. Both behaviours are covered by new tests: a dropped entry no longer inflates the count, and eight 128 KiB avatars are trimmed to the budget (measured at 1048576 bytes without the bound).
This commit is contained in:
1 parent
bfa26da9eb
commit
bcc78177c2
5 files changed
+89
-7
No files matched your search
@@ -78,6 +78,14 @@ export type ScreenSharePeerSignal =
|
||||
kind: "close";
|
||||
};
|
||||
|
||||
/**
|
||||
* Ceiling on the total inline avatar bytes a client accepts from a legacy
|
||||
* gateway for one viewer roster. Current gateways send client ids instead of
|
||||
* avatars, so this bounds only the compatibility path; a per-entry limit alone
|
||||
* would still admit 64 x 128 KiB in a single broadcast.
|
||||
*/
|
||||
export const SCREEN_SHARE_LEGACY_AVATAR_BUDGET = 256 * 1024;
|
||||
|
||||
export interface ScreenShareViewerDescription {
|
||||
peerId: string;
|
||||
nickname: string;
|
||||
|
||||
Reference in new issue
Block a user