修复rtsp推流服务器在udp模式下的bug

优化代码
This commit is contained in:
xiongziliang
2019-03-28 11:52:07 +08:00
parent d208f69730
commit 6045b1b8f8
7 changed files with 84 additions and 73 deletions

View File

@@ -549,6 +549,7 @@ bool RtspSession::handleReq_Setup(const Parser &parser) {
return false;
}
trackRef->_inited = true; //现在初始化
trackRef->_interleaved = trackRef->_type * 2;
if(_rtpType == Rtsp::RTP_Invalid){
auto strTransport = parser["Transport"];
@@ -566,7 +567,6 @@ bool RtspSession::handleReq_Setup(const Parser &parser) {
switch (_rtpType) {
case Rtsp::RTP_TCP: {
trackRef->_interleaved = trackRef->_type * 2;
sendRtspResponse("200 OK",
{"Transport",StrPrinter << "RTP/AVP/TCP;unicast;"
<< "interleaved=" << trackRef->_type * 2 << "-" << trackRef->_type * 2 + 1 << ";"