Browse Source

fix crash

pull/442/head
aler9 5 years ago
parent
commit
b142b015c7
  1. 7
      internal/path/path.go
  2. 2
      internal/rtspsession/session.go

7
internal/path/path.go

@ -558,10 +558,15 @@ func (pa *Path) onReadPublisherSetupPlayPost(req readpublisher.SetupPlayReq) { @@ -558,10 +558,15 @@ func (pa *Path) onReadPublisherSetupPlayPost(req readpublisher.SetupPlayReq) {
pa.addReadPublisher(req.Author, readPublisherStatePrePlay)
}
var ti []streamproc.TrackInfo
if pa.sp != nil {
ti = pa.sp.TrackInfos()
}
req.Res <- readpublisher.SetupPlayRes{
Path: pa,
Tracks: pa.sourceTracks,
TrackInfos: pa.sp.TrackInfos(),
TrackInfos: ti,
}
}

2
internal/rtspsession/session.go

@ -224,7 +224,7 @@ func (s *Session) OnSetup(c *rtspconn.Conn, ctx *gortsplib.ServerHandlerOnSetupC @@ -224,7 +224,7 @@ func (s *Session) OnSetup(c *rtspconn.Conn, ctx *gortsplib.ServerHandlerOnSetupC
s.setuppedTracks[ctx.TrackID] = res.Tracks[ctx.TrackID]
var ssrc *uint32
if res.TrackInfos[ctx.TrackID].LastSSRC != 0 {
if res.TrackInfos != nil && res.TrackInfos[ctx.TrackID].LastSSRC != 0 {
ssrc = &res.TrackInfos[ctx.TrackID].LastSSRC
}

Loading…
Cancel
Save