mirror of
https://github.com/jech/galene.git
synced 2024-11-26 02:25: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) {
|
pc.OnTrack(func(remote *webrtc.Track, receiver *webrtc.RTPReceiver) {
|
||||||
conn.mu.Lock()
|
conn.mu.Lock()
|
||||||
defer conn.mu.Unlock()
|
|
||||||
|
|
||||||
mid := getTrackMid(pc, remote)
|
mid := getTrackMid(pc, remote)
|
||||||
if mid == "" {
|
if mid == "" {
|
||||||
|
@ -435,11 +434,19 @@ func newUpConn(c client, id string) (*rtpUpConnection, error) {
|
||||||
|
|
||||||
go rtcpUpListener(conn, track, receiver)
|
go rtcpUpListener(conn, track, receiver)
|
||||||
|
|
||||||
if conn.complete() {
|
complete := conn.complete()
|
||||||
tracks := make([]upTrack, len(conn.tracks))
|
var tracks []upTrack
|
||||||
|
if(complete) {
|
||||||
|
tracks = make([]upTrack, len(conn.tracks))
|
||||||
for i, t := range conn.tracks {
|
for i, t := range conn.tracks {
|
||||||
tracks[i] = t
|
tracks[i] = t
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// pushConn might need to take the lock
|
||||||
|
conn.mu.Unlock()
|
||||||
|
|
||||||
|
if complete {
|
||||||
clients := c.Group().getClients(c)
|
clients := c.Group().getClients(c)
|
||||||
for _, cc := range clients {
|
for _, cc := range clients {
|
||||||
cc.pushConn(conn.id, conn, tracks, conn.label)
|
cc.pushConn(conn.id, conn, tracks, conn.label)
|
||||||
|
|
Loading…
Reference in a new issue