WebScreenShareFixes: fix malformed SDP#4159
Merged
Merged
Conversation
coleleavitt
force-pushed
the
fix/wssf-malformed-sdp
branch
from
May 1, 2026 01:54
8e3def4 to
100f02a
Compare
…roots - x-google-max-bitrate=80_000 -> 80000 (underscore invalid in SDP per RFC 4566) - remove b=AS:800000 fmtp injection (b=AS is session-level, not fmtp) Both caused Discord RTC server to reject the video codec on niri/wlroots. Firefox-Discord (no Vencord) was unaffected, masking the bug on Mutter.
coleleavitt
force-pushed
the
fix/wssf-malformed-sdp
branch
from
May 1, 2026 01:55
100f02a to
e87793a
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes WebScreenShareFixes generating malformed SDP in the web (Chromium/Vesktop) pipeline, which could cause Discord’s RTC server to reject the offer/answer on some Wayland compositors (wlroots/niri/hyprland/sway), resulting in screenshare starting but showing no video to viewers.
Changes:
- Replace the injected SDP fmtp value
x-google-max-bitrate=80_000withx-google-max-bitrate=80000to avoid sending an underscore in the SDP integer. - Remove the invalid injection of
b=AS:800000inside ana=fmtp:parameter list (not valid SDP syntax in that position).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
aislop |
marcmy
added a commit
to marcmy/Vencord
that referenced
this pull request
Jul 7, 2026
* fix ReviewDB & other stuff (Vendicated#4264) * CustomCommands: fix rename leading to duplicate commands Closes Vendicated#4283 * fix CallTimer (Vendicated#4280) * PinDMS: fix duplicate context menu ids (Vendicated#4274) * ViewRaw: add profile support * Fix AccountPanelServerProfile sometimes erroring (Vendicated#4252) * SupportHelper: improve snippet functionality (Vendicated#4282) * WebScreenShareFixes: fix malformed SDP (Vendicated#4159) * VcNarrator: don't narrate twice when using Overlay (Vendicated#4300) Fixes Vendicated#2717 * SupportHelper: add "Run Snippet" to all issue posts (Vendicated#4289) * AppleMusicRichPresence: make links customizable (Vendicated#4298) * ViewRaw: improve UI * BetterRoleContext: support role headers in member list (Vendicated#4276) Co-authored-by: Vendicated <vendicated@riseup.net> * Add Display Names for Settings (Vendicated#3212) * AlwaysAnimate: support gradient roles (Vendicated#3528) * ReviewDB: it's a big day for reddit nation (Vendicated#4216) add updoots/downdoots * ShikiCodeblocks: Fix line numbers wrapping in modals (Vendicated#4310) * ReviewDB: Fix DM Profile Sidebar Patch (Vendicated#4315) * fix PlatformIndicator badges appearing as blank * Delete FriendsSince - now a stock Discord feature * CharacterCounter: add selected text count (Vendicated#4129) Co-authored-by: V <vendicated@riseup.net> * PermissionsViewer: only show relevant permissions * v1.14.14 * fix various plugins (Vendicated#4328) Co-authored-by: thororen <78185467+thororen1234@users.noreply.github.com> Co-authored-by: Vendicated <vendicated@riseup.net> * sigh... v1.14.15 * YoutubeAdblock: fix lag/high memory usage after clicking videos (Vendicated#4317) * Updater: fix potentially erroring in edge case * Fix FakeNitro sticker support * upgrade pnpm & dependencies * Fix Decor, GameActivityToggle, SpotifyControls Finds (Vendicated#4366) * ci: declare read-only permissions for tests * ci: declare read-only permissions for patch reports * ci: scope dev build token permissions * ci: declare read-only permissions for mirror workflow * ci: declare read-only permissions for browser publishing * fix(browser): validate response URL hostnames * build: remove legacy zip-local dependency * deps: override vulnerable transitive packages * build: create extension archives with fflate * ci: refresh security lockfile * security: document intentional Dev Companion evaluation * security: document intentional patch regex construction * ci: finish generated security updates * ci: run security generation for pull request * ci: self-remove security generation helper * deps: refresh lockfile after security overrides * deps: refresh lockfile and document bounded regexes * deps: refresh lockfile and document bounded regexes * ci: split test suite into diagnosable steps * style: restore canonical source header * style: restore Dev Companion source header * ci: apply final CodeQL hardening fixes * security: make lazy chunk matching linear * security: bound Dev Companion dynamic inputs * security: document trusted regex canonicalization * ci: narrow CodeQL patch helper to shared matcher * security: make shared chunk matcher linear * ci: remove completed CodeQL patch helper * security: anchor Dev Companion CodeQL suppressions --------- Co-authored-by: thororen <78185467+thororen1234@users.noreply.github.com> Co-authored-by: Vendicated <vendicated@riseup.net> Co-authored-by: Clov <273623891+chloricacid@users.noreply.github.com> Co-authored-by: Cole W. Leavitt <75138914+coleleavitt@users.noreply.github.com> Co-authored-by: 5xk <gabrhhfk@gmail.com> Co-authored-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Co-authored-by: NightmareSan7 <NightmareSan@web.de> Co-authored-by: Suffocate <70031311+lolsuffocate@users.noreply.github.com> Co-authored-by: Lumap <lumap@duck.com> Co-authored-by: Manti <67705577+mantikafasi@users.noreply.github.com> Co-authored-by: sadan4 <117494111+sadan4@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
WebScreenShareFixesplugin generates SDP that Discord's RTC server silently rejects on non-Mutter Wayland compositors (niri, hyprland, sway), causing "chooser appears, you pick, viewers see nothing" for Vesktop users on those compositors. Two specific bugs in the plugin:x-google-max-bitrate=80_000— JavaScript numeric-literal underscore separator. The80_000is a valid JS literal (= 80000) but the replacement string is interpolated literally into the SDP, producingx-google-max-bitrate=80_000(with underscore) on the wire. RFC 4566 requires plain integers; Discord's parser rejects this fmtp parameter and falls back to a codec the encoder isn't configured to send.b=AS:800000injected inside ana=fmtp:line.b=AS:is a session/media-level bandwidth attribute (its own SDP line per RFC 4566), not an fmtp parameter. Injecting it insidea=fmtp:96 ...;b=AS:800000;level-asymmetry-allowed=1;...produces malformed SDP. Discord rejects the entire H.264 codec line.Why this only surfaces now
Discord-in-Firefox uses the web JS pipeline (no Vencord, no SDP munging) and sends valid SDP — works everywhere. Discord-in-Chromium-via-Vencord on GNOME/Mutter also worked because Mutter's WebRTC stack has lenient SDP parsing OR because the codec falls back gracefully. On niri/hyprland/sway the rejection is fatal.
Fix
Removed the entire
b=AS:injection — it was never valid SDP. The 80 Mbps bitrate cap removal (which is the legitimate purpose of the plugin per its description) still works via the correctedx-google-max-bitrate=80000line.Test plan
Empirically verified on Vesktop 1.6.5 + Vencord v1.14.10 + niri 26.04 + Electron 40.4.0 + Chromium 144 + xdg-desktop-portal-gnome 48:
No regression on Mutter/GNOME — verified the corrected SDP is still accepted there.
Refs
2026-03-linux-vulkan-captureexperiment (separate but coexisting issue)