fix crash

This commit is contained in:
aler9 2021-05-16 16:26:45 +02:00
parent 82cf73af70
commit b142b015c7
2 changed files with 7 additions and 2 deletions

View file

@ -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,
}
}

View file

@ -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
}