mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-25 20:41:59 -08:00
fix crash
This commit is contained in:
parent
82cf73af70
commit
b142b015c7
2 changed files with 7 additions and 2 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue