mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 02:34:26 +08:00
兼容webrtc offer sdp中重复行的情况 (#3038)
This commit is contained in:
parent
644a333ec3
commit
586bb73912
@ -267,16 +267,23 @@ 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.emplace(line).second) {
|
||||
continue;
|
||||
}
|
||||
|
||||
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
Block a user