commit 62d872baa17c3aa50ac168121b3bf041a87a1d1e
parent 9c6fac590c320c4d27b94fd7d48ddfe43198708b
Author: Nico Grunbaum <na-g@nostrum.com>
Date: Thu, 9 Oct 2025 17:18:42 +0000
Bug 1993149 - preserve SSRC order in RecvTrackSetRemote;r=dbaker
The intermediate set used is ordered by key, not by insertion order.
This made JsepTrackTest.SimulcastRejected fail. I think that the test
may be over zealous in the check, but it is easy enough to preserve
the original ordering.
Differential Revision: https://phabricator.services.mozilla.com/D268097
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dom/media/webrtc/jsep/JsepTrack.cpp b/dom/media/webrtc/jsep/JsepTrack.cpp
@@ -161,10 +161,14 @@ void JsepTrack::RecvTrackSetRemote(const Sdp& aSdp,
std::set<uint32_t> ssrcsSet;
if (aMsection.GetAttributeList().HasAttribute(SdpAttribute::kSsrcAttribute)) {
for (const auto& s : aMsection.GetAttributeList().GetSsrc().mSsrcs) {
+ if (ssrcsSet.find(s.ssrc) != ssrcsSet.end()) {
+ continue;
+ }
ssrcsSet.insert(s.ssrc);
+ // Preserve order of ssrcs as they appear in the m-section
+ mSsrcs.push_back(s.ssrc);
}
}
- mSsrcs.assign(ssrcsSet.begin(), ssrcsSet.end());
// Use FID ssrc-group to associate rtx ssrcs with "regular" ssrcs. Despite
// not being part of RFC 4588, this is how rtx is negotiated by libwebrtc