Merge remote-tracking branch 'origin/master' into rtmps_listen

pull/230/head
Jae-Sung Lee 2 years ago
commit 1f3e5169e2

@ -2,4 +2,4 @@ module github.com/q191201771/lal
go 1.14
require github.com/q191201771/naza v0.30.7
require github.com/q191201771/naza v0.30.8

@ -1,2 +1,2 @@
github.com/q191201771/naza v0.30.7 h1:HcnhhLM5nVZeuxi4b7/sSnU0B6XtIC7LkMe6pITsFwc=
github.com/q191201771/naza v0.30.7/go.mod h1:n+dpJjQSh90PxBwxBNuifOwQttywvSIN5TkWSSYCeBk=
github.com/q191201771/naza v0.30.8 h1:Lhh29o65C4PmTDj2l+eKfsw9dddpgWZk4bFICtcnSaA=
github.com/q191201771/naza v0.30.8/go.mod h1:n+dpJjQSh90PxBwxBNuifOwQttywvSIN5TkWSSYCeBk=

@ -443,8 +443,26 @@ func (session *ClientCommandSession) writeOneSetup(setupUri string) error {
session.sessionId = strings.Split(ctx.Headers.Get(HeaderSession), ";")[0]
rRtpPort, rRtcpPort, err := parseServerPort(ctx.Headers.Get(HeaderTransport))
var rtpRAddr, rtcpRAddr string
if err != nil {
return err
// 增强兼容性逻辑
// 有用户反馈存在对端不返回server_port的情况对端是easydrawin
// 其实在pull的情况下没有对端端口也可以因为不发数据或者需要发送时使用接收时获取到的对端地址即可
Log.Warnf("[%s] init conn, parseServerPort failed. lRtpPort=%d, lRtcpPort=%d",
session.uniqueKey, lRtpPort, lRtcpPort)
switch session.t {
case CcstPullSession:
// noop
case CcstPushSession:
fallthrough
default:
return err
}
} else {
rtpRAddr = net.JoinHostPort(session.urlCtx.Host, fmt.Sprintf("%d", rRtpPort))
rtcpRAddr = net.JoinHostPort(session.urlCtx.Host, fmt.Sprintf("%d", rRtcpPort))
}
Log.Debugf("[%s] init conn. lRtpPort=%d, lRtcpPort=%d, rRtpPort=%d, rRtcpPort=%d",
@ -452,7 +470,7 @@ func (session *ClientCommandSession) writeOneSetup(setupUri string) error {
rtpConn, err := nazanet.NewUdpConnection(func(option *nazanet.UdpConnectionOption) {
option.Conn = rtpC
option.RAddr = net.JoinHostPort(session.urlCtx.Host, fmt.Sprintf("%d", rRtpPort))
option.RAddr = rtpRAddr
option.MaxReadPacketSize = rtprtcp.MaxRtpRtcpPacketSize
})
if err != nil {
@ -461,7 +479,7 @@ func (session *ClientCommandSession) writeOneSetup(setupUri string) error {
rtcpConn, err := nazanet.NewUdpConnection(func(option *nazanet.UdpConnectionOption) {
option.Conn = rtcpC
option.RAddr = net.JoinHostPort(session.urlCtx.Host, fmt.Sprintf("%d", rRtcpPort))
option.RAddr = rtcpRAddr
option.MaxReadPacketSize = rtprtcp.MaxRtpRtcpPacketSize
})
if err != nil {

Loading…
Cancel
Save