|
@@ -656,9 +656,8 @@ std::optional<std::string> PeerConnection::getMidFromSSRC(SSRC ssrc) {
|
|
|
if (auto it = mMidFromSssrc.find(ssrc); it != mMidFromSssrc.end()) {
|
|
|
return it->second;
|
|
|
} else {
|
|
|
- std::lock_guard lock(mLocalDescriptionMutex);
|
|
|
- if (!mLocalDescription)
|
|
|
- return nullopt;
|
|
|
+ std::lock_guard lockA(mRemoteDescriptionMutex);
|
|
|
+ if (mRemoteDescription) {
|
|
|
|
|
|
for (unsigned int i = 0; i < mRemoteDescription->mediaCount(); ++i) {
|
|
|
if (auto found = std::visit(
|
|
@@ -676,7 +675,10 @@ std::optional<std::string> PeerConnection::getMidFromSSRC(SSRC ssrc) {
|
|
|
return *found;
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ std::lock_guard lockB(mLocalDescriptionMutex);
|
|
|
+ if (mLocalDescription) {
|
|
|
for (unsigned int i = 0; i < mLocalDescription->mediaCount(); ++i) {
|
|
|
if (auto found = std::visit(
|
|
|
rtc::overloaded{[&](Description::Application *) -> std::optional<string> {
|
|
@@ -693,6 +695,7 @@ std::optional<std::string> PeerConnection::getMidFromSSRC(SSRC ssrc) {
|
|
|
return *found;
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
return nullopt;
|
|
|
}
|