mirror of
https://github.com/jech/galene.git
synced 2024-11-22 16:45:58 +01:00
Release lock early in newUpConn.
Otherwise recording to disk causes a deadlock.
This commit is contained in:
parent
fa29e50f8b
commit
96dbcd9dcb
1 changed files with 10 additions and 3 deletions
13
rtpconn.go
13
rtpconn.go
|
@ -400,7 +400,6 @@ func newUpConn(c client, id string) (*rtpUpConnection, error) {
|
|||
|
||||
pc.OnTrack(func(remote *webrtc.Track, receiver *webrtc.RTPReceiver) {
|
||||
conn.mu.Lock()
|
||||
defer conn.mu.Unlock()
|
||||
|
||||
mid := getTrackMid(pc, remote)
|
||||
if mid == "" {
|
||||
|
@ -435,11 +434,19 @@ func newUpConn(c client, id string) (*rtpUpConnection, error) {
|
|||
|
||||
go rtcpUpListener(conn, track, receiver)
|
||||
|
||||
if conn.complete() {
|
||||
tracks := make([]upTrack, len(conn.tracks))
|
||||
complete := conn.complete()
|
||||
var tracks []upTrack
|
||||
if(complete) {
|
||||
tracks = make([]upTrack, len(conn.tracks))
|
||||
for i, t := range conn.tracks {
|
||||
tracks[i] = t
|
||||
}
|
||||
}
|
||||
|
||||
// pushConn might need to take the lock
|
||||
conn.mu.Unlock()
|
||||
|
||||
if complete {
|
||||
clients := c.Group().getClients(c)
|
||||
for _, cc := range clients {
|
||||
cc.pushConn(conn.id, conn, tracks, conn.label)
|
||||
|
|
Loading…
Reference in a new issue