Browse Source

代码优化

pull/203/head
mask-pp 4 years ago
parent
commit
785f293376
  1. 6
      rtsp/pusher.go

6
rtsp/pusher.go

@ -354,12 +354,8 @@ func (pusher *Pusher) RemovePlayer(player *Player) *Pusher {
func (pusher *Pusher) ClearPlayer() {
// copy a new map to avoid deadlock
players := make(map[string]*Player)
pusher.playersLock.Lock()
for k, v := range pusher.players {
//v.Stop()
players[k] = v
}
players := pusher.players
pusher.players = make(map[string]*Player)
pusher.playersLock.Unlock()
go func() { // do not block

Loading…
Cancel
Save