From 7122258d7c01310bc79da89b4556c0d6c41c55e1 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Wed, 2 Sep 2026 00:10:02 +0700 Subject: [PATCH] fix(voice): read SSRCMap internal map via 'map' (not '_map') videoReceiver.getSsrcInternalMap read asAny._map, but @discordjs/voice 0.19.x exposes the SSRC map as the public field 'map'. So inferVideoOwner (e.g. matching a video RTP SSRC to a user via audio-SSRC proximity) always returned null -> every video packet was silently dropped after decryption. Accept both 'map' and '_map'. Unblocks camera/screen-share attribute when op12 does not carry a videoSSRC stream entry. --- .../src/modules/voice-recording/videoReceiver.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/discord-gateway/src/modules/voice-recording/videoReceiver.ts b/services/discord-gateway/src/modules/voice-recording/videoReceiver.ts index 62ab7a9c..1ab61e5b 100644 --- a/services/discord-gateway/src/modules/voice-recording/videoReceiver.ts +++ b/services/discord-gateway/src/modules/voice-recording/videoReceiver.ts @@ -396,8 +396,13 @@ function getSsrcInternalMap( | Map | undefined { const asAny = ssrcMap as unknown as Record; - const m1 = asAny._map; + // @discordjs/voice 0.19.x exposes the map as `map` (public) — but some + // versions used `_map`. Accept both so attribute fallback keeps working. + const m1 = asAny.map ?? asAny._map; if (m1 instanceof Map) return m1 as Map; + // SSRCMap could also be the fork's class — same shape. + const m2 = asAny.map; + if (m2 instanceof Map) return m2 as Map; return undefined; }