mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
examples: add missing mutex in OnSetup (#729)
This commit is contained in:
@@ -107,6 +107,9 @@ func (sh *serverHandler) OnAnnounce(ctx *gortsplib.ServerHandlerOnAnnounceCtx) (
|
||||
func (sh *serverHandler) OnSetup(ctx *gortsplib.ServerHandlerOnSetupCtx) (*base.Response, *gortsplib.ServerStream, error) {
|
||||
log.Printf("setup request")
|
||||
|
||||
sh.mutex.Lock()
|
||||
defer sh.mutex.Unlock()
|
||||
|
||||
// no one is publishing yet
|
||||
if sh.stream == nil {
|
||||
return &base.Response{
|
||||
|
Reference in New Issue
Block a user