修复rtsp sdp解析的bug

This commit is contained in:
xiongziliang 2021-08-28 13:02:53 +08:00
parent 2242577661
commit d2f02c0a0c

View File

@ -235,7 +235,7 @@ void SdpParser::load(const string &sdp) {
} }
} }
for (it = track._attr.find("rtpmap"); it != track._attr.end();) { for (it = track._attr.find("rtpmap"); it != track._attr.end() && it->first == "rtpmap";) {
auto &rtpmap = it->second; auto &rtpmap = it->second;
int pt, samplerate, channel; int pt, samplerate, channel;
char codec[16] = {0}; char codec[16] = {0};
@ -262,7 +262,7 @@ void SdpParser::load(const string &sdp) {
++it; ++it;
} }
for (it = track._attr.find("fmtp"); it != track._attr.end(); ) { for (it = track._attr.find("fmtp"); it != track._attr.end() && it->first == "fmtp"; ) {
auto &fmtp = it->second; auto &fmtp = it->second;
int pt; int pt;
sscanf(fmtp.data(), "%d", &pt); sscanf(fmtp.data(), "%d", &pt);