mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Fix mid generation bug
This commit is contained in:
parent
b4544acc11
commit
2a3b5e5290
2 changed files with 18 additions and 3 deletions
|
@ -3090,8 +3090,23 @@ void video_track_generate_play_offer(SrsRtcTrackDescription* track, string mid,
|
||||||
|
|
||||||
local_media_desc.extmaps_ = track->extmaps_;
|
local_media_desc.extmaps_ = track->extmaps_;
|
||||||
|
|
||||||
local_media_desc.mid_ = mid; // Use transformed mid, not the mid of track.
|
// If mid not duplicated, use mid_ of track. Otherwise, use transformed mid.
|
||||||
local_sdp.groups_.push_back(local_media_desc.mid_);
|
if (true) {
|
||||||
|
bool mid_duplicated = false;
|
||||||
|
for (int i = 0; i < (int)local_sdp.groups_.size(); ++i) {
|
||||||
|
string& existed_mid = local_sdp.groups_.at(i);
|
||||||
|
if(existed_mid == track->mid_) {
|
||||||
|
mid_duplicated = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mid_duplicated) {
|
||||||
|
local_media_desc.mid_ = mid;
|
||||||
|
} else {
|
||||||
|
local_media_desc.mid_ = track->mid_;
|
||||||
|
}
|
||||||
|
local_sdp.groups_.push_back(local_media_desc.mid_);
|
||||||
|
}
|
||||||
|
|
||||||
if (track->direction_ == "recvonly") {
|
if (track->direction_ == "recvonly") {
|
||||||
local_media_desc.recvonly_ = true;
|
local_media_desc.recvonly_ = true;
|
||||||
|
|
|
@ -381,7 +381,7 @@ public:
|
||||||
bool is_active_;
|
bool is_active_;
|
||||||
// direction
|
// direction
|
||||||
std::string direction_;
|
std::string direction_;
|
||||||
// TODO: FIXME: whether mid is needed?
|
// mid is used in BOUNDLE
|
||||||
std::string mid_;
|
std::string mid_;
|
||||||
// msid_: track stream id
|
// msid_: track stream id
|
||||||
std::string msid_;
|
std::string msid_;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue