mirror of
https://github.com/jech/galene.git
synced 2024-11-10 02:35:58 +01:00
Check for connection state if not sending report packet.
This avoids a situation when an RTCP sender never terminates.
This commit is contained in:
parent
f70ff2424e
commit
f277b42e26
1 changed files with 8 additions and 0 deletions
|
@ -799,6 +799,10 @@ func sendRR(conn *rtpUpConnection) error {
|
|||
defer conn.mu.Unlock()
|
||||
|
||||
if len(conn.tracks) == 0 {
|
||||
state := conn.pc.ConnectionState()
|
||||
if state == webrtc.PeerConnectionStateClosed {
|
||||
return io.ErrClosedPipe
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -899,6 +903,10 @@ func sendSR(conn *rtpDownConnection) error {
|
|||
}
|
||||
|
||||
if len(packets) == 0 {
|
||||
state := conn.pc.ConnectionState()
|
||||
if state == webrtc.PeerConnectionStateClosed {
|
||||
return io.ErrClosedPipe
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue