Skip to content

Commit

Permalink
fix(core): set local descriptor after remote counterpart
Browse files Browse the repository at this point in the history
Fixed an issue where, in glare scenarios, the negotiation role would be
flagged as OFFERER incorrectly.

The whole things sucks all around, but the tldr rationale is: remote
descriptors *may* be undefined at media unit creation time, but local ones
*will not be undefined* if a remote descriptor is unset - so local
descriptors must be processed first if they exist (for scenarios where both
local and remote are provided at the same time). That guarantees the
negotiation role will be properly flagged as ANSWERER in this specific
scenario.
  • Loading branch information
prlanzarin committed May 31, 2022
1 parent 07723a9 commit cc2bad7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/mcs-core/lib/model/sdp-media.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ module.exports = class SDPMedia extends Media {
this._localDescriptor;
this.negotiationRole = '';

if (localDescriptor) {
this.localDescriptor = localDescriptor;
}

if (remoteDescriptor) {
this.remoteDescriptor = remoteDescriptor;
}

if (localDescriptor) {
this.localDescriptor = localDescriptor;
}

Logger.info("SDP media: created", this.getMediaInfo());
}

Expand Down

0 comments on commit cc2bad7

Please sign in to comment.