Skip to content

Commit

Permalink
Emit candidates for bundle offerer-tagged m= section
Browse files Browse the repository at this point in the history
  • Loading branch information
paullouisageneau committed Jun 3, 2022
1 parent 7ecae40 commit 6037b86
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/description.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,12 @@ string Description::typeString() const { return typeToString(mType); }
Description::Role Description::role() const { return mRole; }

string Description::bundleMid() const {
// Get the mid of the first media
return !mEntries.empty() ? mEntries[0]->mid() : "0";
// Get the mid of the first non-removed media
for (const auto &entry : mEntries)
if (!entry->isRemoved())
return entry->mid();

return "0";
}

optional<string> Description::iceUfrag() const { return mIceUfrag; }
Expand Down Expand Up @@ -321,7 +325,7 @@ string Description::generateSdp(string_view eol) const {
for (const auto &entry : mEntries) {
sdp << entry->generateSdp(eol, addr, port);

if (std::exchange(first, false)) {
if (!entry->isRemoved() && std::exchange(first, false)) {
// Candidates
for (const auto &candidate : mCandidates)
sdp << string(candidate) << eol;
Expand Down

0 comments on commit 6037b86

Please sign in to comment.