对推流可能无法解析的情况进行报错

This commit is contained in:
dexter
2022-05-10 21:58:35 +08:00
parent 91e1726920
commit 76956b16d1
2 changed files with 10 additions and 4 deletions

View File

@@ -91,7 +91,9 @@ func (conf *RTSPConfig) OnAnnounce(ctx *gortsplib.ServerHandlerOnAnnounceCtx) (*
if err := plugin.Publish(ctx.Path, p); err == nil {
p.tracks = ctx.Tracks
p.stream = gortsplib.NewServerStream(ctx.Tracks)
p.SetTracks()
if err = p.SetTracks(); err != nil {
return nil, err
}
conf.Store(ctx.Conn, p)
conf.Store(ctx.Session, p)
} else {