Commit a42b56ba by xiongziliang

兼容Firefox

parent b5bf9304
......@@ -604,10 +604,11 @@ void SdpAttrFmtp::parse(const string &str) {
trim(item);
auto pos = item.find('=');
if(pos == string::npos){
SDP_THROW();
}
arr.emplace_back(std::make_pair(item, ""));
} else {
arr.emplace_back(std::make_pair(item.substr(0, pos), item.substr(pos + 1)));
}
}
if (arr.empty()) {
SDP_THROW();
}
......@@ -784,6 +785,9 @@ void RtcSession::loadFrom(const string &str, bool check) {
rtc_media.ice_pwd = media.getStringItem('a', "ice-pwd");
rtc_media.role = media.getItemClass<SdpAttrSetup>('a', "setup").role;
rtc_media.fingerprint = media.getItemClass<SdpAttrFingerprint>('a', "fingerprint");
if (rtc_media.fingerprint.empty()) {
rtc_media.fingerprint = sdp.getItemClass<SdpAttrFingerprint>('a', "fingerprint");
}
rtc_media.ice_lite = media.getItem('a', "ice-lite").operator bool();
auto ice_options = media.getItemClass<SdpAttrIceOption>('a', "ice-options");
rtc_media.ice_trickle = ice_options.trickle;
......
......@@ -301,6 +301,7 @@ public:
void parse(const string &str) override;
string toString() const override;
const char* getKey() const override { return "fingerprint";}
bool empty() const { return algorithm.empty() || hash.empty(); }
};
class SdpAttrSetup : public SdpItem {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论