mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-03 08:57:32 +08:00
candidate foundation改为string类型
This commit is contained in:
@@ -689,14 +689,16 @@ string SdpAttrSctpMap::toString() const {
|
||||
}
|
||||
|
||||
void SdpAttrCandidate::parse(const string &str) {
|
||||
char foundation_buf[32] = {0};
|
||||
char transport_buf[16] = {0};
|
||||
char address_buf[32] = {0};
|
||||
char type_buf[16] = {0};
|
||||
|
||||
if (7 != sscanf(str.data(), "%" SCNu32 " %" SCNu32 " %15[^ ] %" SCNu32 " %31[^ ] %" SCNu16 " typ %15[^ ]",
|
||||
&foundation, &component, transport_buf, &priority, address_buf, &port, type_buf)) {
|
||||
if (7 != sscanf(str.data(), "%31[^ ] %" SCNu32 " %15[^ ] %" SCNu32 " %31[^ ] %" SCNu16 " typ %15[^ ]",
|
||||
foundation_buf, &component, transport_buf, &priority, address_buf, &port, type_buf)) {
|
||||
SDP_THROW();
|
||||
}
|
||||
foundation = foundation_buf;
|
||||
transport = transport_buf;
|
||||
address = address_buf;
|
||||
type = type_buf;
|
||||
@@ -720,7 +722,7 @@ void SdpAttrCandidate::parse(const string &str) {
|
||||
|
||||
string SdpAttrCandidate::toString() const {
|
||||
if (value.empty()) {
|
||||
value = to_string(foundation) + " " + to_string(component) + " " + transport + " " + to_string(priority) +
|
||||
value = foundation + " " + to_string(component) + " " + transport + " " + to_string(priority) +
|
||||
" " + address + " " + to_string(port) + " typ " + type;
|
||||
for (auto &pr : arr) {
|
||||
value += ' ';
|
||||
|
||||
Reference in New Issue
Block a user