diff --git a/server.go b/server.go index dcdb142d..0dd14516 100644 --- a/server.go +++ b/server.go @@ -9,8 +9,6 @@ import ( "sync" "time" - "github.com/google/uuid" - "github.com/bluenviron/gortsplib/v3/pkg/base" "github.com/bluenviron/gortsplib/v3/pkg/liberrors" ) @@ -410,9 +408,8 @@ func (s *Server) run() { continue } - secretID := uuid.New().String() - ss := newServerSession(s, secretID, req.sc) - s.sessions[secretID] = ss + ss := newServerSession(s, req.sc) + s.sessions[ss.secretID] = ss select { case ss.request <- req: diff --git a/server_session.go b/server_session.go index a17a1ca4..afd7cbde 100644 --- a/server_session.go +++ b/server_session.go @@ -9,6 +9,7 @@ import ( "sync/atomic" "time" + "github.com/google/uuid" "github.com/pion/rtcp" "github.com/pion/rtp" @@ -198,11 +199,13 @@ type ServerSession struct { func newServerSession( s *Server, - secretID string, author *ServerConn, ) *ServerSession { ctx, ctxCancel := context.WithCancel(s.ctx) + // use an UUID without dashes, since dashes confuse some clients. + secretID := strings.ReplaceAll(uuid.New().String(), "-", "") + ss := &ServerSession{ s: s, secretID: secretID,