mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-22 23:25:33 +00:00
fix getCNameForSsrc
This commit is contained in:
@ -882,9 +882,12 @@ std::vector<uint32_t> Description::Media::getSSRCs() { return mSsrcs; }
|
|||||||
std::optional<std::string> Description::Media::getCNameForSsrc(uint32_t ssrc) {
|
std::optional<std::string> Description::Media::getCNameForSsrc(uint32_t ssrc) {
|
||||||
for (auto &val : mAttributes) {
|
for (auto &val : mAttributes) {
|
||||||
if (val.find("ssrc:") == 0 && val.find("cname:") != std::string::npos) {
|
if (val.find("ssrc:") == 0 && val.find("cname:") != std::string::npos) {
|
||||||
|
auto valSsrc = to_integer<uint32_t>(val.substr(5));
|
||||||
|
if (valSsrc == ssrc) {
|
||||||
return val.substr(val.find("cname:") + 6);
|
return val.substr(val.find("cname:") + 6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user