From 4fd53c98d9fd219521a4f02ffcfba158cab6c4aa Mon Sep 17 00:00:00 2001 From: q191201771 <191201771@qq.com> Date: Wed, 7 Sep 2022 23:04:29 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20rtsp:=20server=E7=AB=AF=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=94=B6=E5=88=B0=E5=89=8D=E9=9D=A2=E7=9A=84=E4=BF=A1?= =?UTF-8?q?=E4=BB=A4=E7=9B=B4=E6=8E=A5=E6=94=B6=E5=88=B0PLAY=E4=BF=A1?= =?UTF-8?q?=E4=BB=A4=EF=BC=8C=E4=B8=BB=E5=8A=A8=E5=85=B3=E9=97=AD=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=EF=BC=8C=E9=81=BF=E5=85=8D=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/rtsp/server_command_session.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/rtsp/server_command_session.go b/pkg/rtsp/server_command_session.go index 69aaea9..6bfaf55 100644 --- a/pkg/rtsp/server_command_session.go +++ b/pkg/rtsp/server_command_session.go @@ -420,6 +420,13 @@ func (session *ServerCommandSession) handleRecord(requestCtx nazahttp.HttpReqMsg func (session *ServerCommandSession) handlePlay(requestCtx nazahttp.HttpReqMsgCtx) error { Log.Infof("[%s] < R PLAY", session.uniqueKey) + + // 没有收到前面的信令,直接收到Play信令 + if session.subSession == nil { + Log.Errorf("[%s] handlePlay but subSession not exist.", session.uniqueKey) + return base.ErrRtsp + } + // TODO(chef): [opt] 上层关闭,可以考虑回复非200状态码再关闭 if err := session.observer.OnNewRtspSubSessionPlay(session.subSession); err != nil { return err