提高rtsp兼容性: #551

This commit is contained in:
xiongziliang 2020-11-07 17:45:58 +08:00
parent ba7251f345
commit 57a11f19dd
2 changed files with 6 additions and 0 deletions

View File

@ -223,6 +223,9 @@ void RtspPlayer::sendSetup(unsigned int track_idx) {
_on_response = std::bind(&RtspPlayer::handleResSETUP, this, placeholders::_1, track_idx);
auto &track = _sdp_track[track_idx];
auto baseUrl = _content_base + "/" + track->_control_surffix;
if (track->_control.find("://") != string::npos) {
baseUrl = track->_control;
}
switch (_rtp_type) {
case Rtsp::RTP_TCP: {
sendRtspRequest("SETUP",baseUrl,{"Transport",StrPrinter << "RTP/AVP/TCP;unicast;interleaved=" << track->_type * 2 << "-" << track->_type * 2 + 1});

View File

@ -239,6 +239,9 @@ void RtspPusher::sendSetup(unsigned int track_idx) {
_on_res_func = std::bind(&RtspPusher::handleResSetup, this, placeholders::_1, track_idx);
auto &track = _track_vec[track_idx];
auto base_url = _content_base + "/" + track->_control_surffix;
if (track->_control.find("://") != string::npos) {
base_url = track->_control;
}
switch (_rtp_type) {
case Rtsp::RTP_TCP: {
sendRtspRequest("SETUP", base_url, {"Transport",