Skip to content

Commit

Permalink
webrtc wpt: use unused extension id for mid when offering to receive …
Browse files Browse the repository at this point in the history
…simulcast

since mid is mandatory to implement per
https://datatracker.ietf.org/doc/html/rfc8853#section-5.5

BUG=chromium:1422258

Change-Id: I1886a345c8fb3acd9389f4553ef77e48644dbad3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4574314
Reviewed-by: Harald Alvestrand <hta@chromium.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1151702}
  • Loading branch information
fippo authored and chromium-wpt-export-bot committed Jun 1, 2023
1 parent d03a2d7 commit 0b432de
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions webrtc/simulcast/simulcast.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ function midToRid(description, localDescription, rids) {
if (localMidExtension) {
rtpParameters.headerExtensions.push(localMidExtension);
}
} else {
// Find unused id in remote description to formally have a mid.
for (let id = 1; id < 15; id++) {
if (rtpParameters.headerExtensions.find(ext => ext.id === id) === undefined) {
rtpParameters.headerExtensions.push(
{id, uri: 'urn:ietf:params:rtp-hdrext:sdes:mid'});
break;
}
}
}

if (!rids) {
Expand Down

0 comments on commit 0b432de

Please sign in to comment.