mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
兼容Firefox
This commit is contained in:
parent
b5bf930467
commit
a42b56ba94
@ -604,10 +604,11 @@ void SdpAttrFmtp::parse(const string &str) {
|
|||||||
trim(item);
|
trim(item);
|
||||||
auto pos = item.find('=');
|
auto pos = item.find('=');
|
||||||
if(pos == string::npos){
|
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)));
|
arr.emplace_back(std::make_pair(item.substr(0, pos), item.substr(pos + 1)));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (arr.empty()) {
|
if (arr.empty()) {
|
||||||
SDP_THROW();
|
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.ice_pwd = media.getStringItem('a', "ice-pwd");
|
||||||
rtc_media.role = media.getItemClass<SdpAttrSetup>('a', "setup").role;
|
rtc_media.role = media.getItemClass<SdpAttrSetup>('a', "setup").role;
|
||||||
rtc_media.fingerprint = media.getItemClass<SdpAttrFingerprint>('a', "fingerprint");
|
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();
|
rtc_media.ice_lite = media.getItem('a', "ice-lite").operator bool();
|
||||||
auto ice_options = media.getItemClass<SdpAttrIceOption>('a', "ice-options");
|
auto ice_options = media.getItemClass<SdpAttrIceOption>('a', "ice-options");
|
||||||
rtc_media.ice_trickle = ice_options.trickle;
|
rtc_media.ice_trickle = ice_options.trickle;
|
||||||
|
@ -301,6 +301,7 @@ public:
|
|||||||
void parse(const string &str) override;
|
void parse(const string &str) override;
|
||||||
string toString() const override;
|
string toString() const override;
|
||||||
const char* getKey() const override { return "fingerprint";}
|
const char* getKey() const override { return "fingerprint";}
|
||||||
|
bool empty() const { return algorithm.empty() || hash.empty(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class SdpAttrSetup : public SdpItem {
|
class SdpAttrSetup : public SdpItem {
|
||||||
|
Loading…
Reference in New Issue
Block a user