兼容重复ssrc的情况
This commit is contained in:
parent
e81ff307c7
commit
721492be9d
|
|
@ -267,16 +267,24 @@ void RtcSessionSdp::parse(const string &str) {
|
|||
static auto flag = registerAllItem();
|
||||
RtcSdpBase *media = nullptr;
|
||||
auto lines = split(str, "\n");
|
||||
for(auto &line : lines){
|
||||
std::set<std::string> line_set;
|
||||
for (auto &line : lines) {
|
||||
trim(line);
|
||||
if(line.size() < 3 || line[1] != '='){
|
||||
if (line.size() < 3 || line[1] != '=') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (line_set.find(line) != line_set.end()) {
|
||||
continue;
|
||||
}
|
||||
line_set.emplace(line);
|
||||
|
||||
auto key = line.substr(0, 1);
|
||||
auto value = line.substr(2);
|
||||
if (!strcasecmp(key.data(), "m")) {
|
||||
medias.emplace_back(RtcSdpBase());
|
||||
media = &medias.back();
|
||||
line_set.clear();
|
||||
}
|
||||
|
||||
SdpItem::Ptr item;
|
||||
|
|
|
|||
Loading…
Reference in New Issue