examples: add missing mutex in OnSetup (#729)

This commit is contained in:
Alessandro Ros
2025-03-23 16:20:54 +01:00
committed by GitHub
parent fcb018151b
commit c8f4a0b0d3
3 changed files with 9 additions and 0 deletions

View File

@@ -147,6 +147,9 @@ func (sh *serverHandler) OnSetup(ctx *gortsplib.ServerHandlerOnSetupCtx) (*base.
}
}
sh.mutex.Lock()
defer sh.mutex.Unlock()
// no one is publishing yet
if sh.stream == nil {
return &base.Response{