Fix dahua nvr rtsp record compatible bug (#3677 #3632)

This commit is contained in:
xiongguangjie 2024-07-05 20:54:06 +08:00 committed by GitHub
parent 9f98c732ec
commit 5b4ec8415d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -257,17 +257,19 @@ void RtspPlayer::sendSetup(unsigned int track_idx) {
switch (_rtp_type) { switch (_rtp_type) {
case Rtsp::RTP_TCP: { case Rtsp::RTP_TCP: {
sendRtspRequest( sendRtspRequest(
"SETUP", control_url, { "Transport", StrPrinter << "RTP/AVP/TCP;unicast;interleaved=" << track->_type * 2 << "-" << track->_type * 2 + 1 }); "SETUP", control_url,
{ "Transport", StrPrinter << "RTP/AVP/TCP;unicast;interleaved=" << track->_type * 2 << "-" << track->_type * 2 + 1 << ";mode=play" });
} break; } break;
case Rtsp::RTP_MULTICAST: { case Rtsp::RTP_MULTICAST: {
sendRtspRequest("SETUP", control_url, { "Transport", "RTP/AVP;multicast" }); sendRtspRequest("SETUP", control_url, { "Transport", "RTP/AVP;multicast;mode=play" });
} break; } break;
case Rtsp::RTP_UDP: { case Rtsp::RTP_UDP: {
createUdpSockIfNecessary(track_idx); createUdpSockIfNecessary(track_idx);
sendRtspRequest( sendRtspRequest(
"SETUP", control_url, "SETUP", control_url,
{ "Transport", { "Transport",
StrPrinter << "RTP/AVP;unicast;client_port=" << _rtp_sock[track_idx]->get_local_port() << "-" << _rtcp_sock[track_idx]->get_local_port() }); StrPrinter << "RTP/AVP;unicast;client_port=" << _rtp_sock[track_idx]->get_local_port() << "-" << _rtcp_sock[track_idx]->get_local_port()
<< ";mode=play" });
} break; } break;
default: break; default: break;
} }