Commit 0764e48f by gongluck Committed by GitHub

兼容安卓平台,to_string模板处理pt值

parent 30984d20
...@@ -556,7 +556,7 @@ void SdpAttrRtpMap::parse(const string &str) { ...@@ -556,7 +556,7 @@ void SdpAttrRtpMap::parse(const string &str) {
string SdpAttrRtpMap::toString() const { string SdpAttrRtpMap::toString() const {
if (value.empty()) { if (value.empty()) {
value = to_string(pt) + " " + codec + "/" + to_string(sample_rate); value = to_string((int)pt) + " " + codec + "/" + to_string(sample_rate);
if (channel) { if (channel) {
value += '/'; value += '/';
value += to_string(channel); value += to_string(channel);
...@@ -574,7 +574,7 @@ void SdpAttrRtcpFb::parse(const string &str_in) { ...@@ -574,7 +574,7 @@ void SdpAttrRtcpFb::parse(const string &str_in) {
string SdpAttrRtcpFb::toString() const { string SdpAttrRtcpFb::toString() const {
if (value.empty()) { if (value.empty()) {
value = to_string(pt) + " " + rtcp_type; value = to_string((int)pt) + " " + rtcp_type;
} }
return SdpItem::toString(); return SdpItem::toString();
} }
...@@ -598,7 +598,7 @@ void SdpAttrFmtp::parse(const string &str) { ...@@ -598,7 +598,7 @@ void SdpAttrFmtp::parse(const string &str) {
string SdpAttrFmtp::toString() const { string SdpAttrFmtp::toString() const {
if (value.empty()) { if (value.empty()) {
value = to_string(pt); value = to_string((int)pt);
int i = 0; int i = 0;
for (auto &pr : fmtp) { for (auto &pr : fmtp) {
value += (i++ ? ';' : ' '); value += (i++ ? ';' : ' ');
...@@ -1070,7 +1070,7 @@ RtcSessionSdp::Ptr RtcSession::toRtcSessionSdp() const{ ...@@ -1070,7 +1070,7 @@ RtcSessionSdp::Ptr RtcSession::toRtcSessionSdp() const{
mline->port = m.port; mline->port = m.port;
mline->proto = m.proto; mline->proto = m.proto;
for (auto &p : m.plan) { for (auto &p : m.plan) {
mline->fmts.emplace_back(to_string(p.pt)); mline->fmts.emplace_back(to_string((int)p.pt));
} }
if (m.type == TrackApplication) { if (m.type == TrackApplication) {
mline->fmts.emplace_back("webrtc-datachannel"); mline->fmts.emplace_back("webrtc-datachannel");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论