优化代码

This commit is contained in:
xiongziliang
2018-09-18 21:40:26 +08:00
parent 83df74561c
commit bb03af0f7f
5 changed files with 42 additions and 6 deletions

View File

@@ -58,6 +58,7 @@ int parserSDP(const string& sdp, RtspTrack Track[2]) {
pos_end = sdp.size();
}
auto sdp_mid = sdp.substr(pos_head, pos_end - pos_head);
pos_head = pos_end;
Track[track_cnt].trackSdp = sdp_mid;
Track[track_cnt].inited = false;
Track[track_cnt].PT = atoi(FindField(sdp_mid.c_str(), "a=rtpmap:", " ").c_str());
@@ -72,9 +73,8 @@ int parserSDP(const string& sdp, RtspTrack Track[2]) {
Track[track_cnt].type = TrackAudio;
} else {
//不识别的track
return track_cnt;
continue;
}
pos_head = pos_end;
track_cnt++;
}
return track_cnt;