mirror of
https://github.com/pion/webrtc.git
synced 2025-09-26 19:21:12 +08:00
Upgrade to golangci-lint@v2
This commit is contained in:
@@ -2089,7 +2089,7 @@ func (pc *PeerConnection) AddTrack(track TrackLocal) (*RTPSender, error) {
|
||||
// But that will cause sdp inflate. So we only check currentDirection's current value,
|
||||
// that's worked for all browsers.
|
||||
if transceiver.kind == track.Kind() && transceiver.Sender() == nil &&
|
||||
!(currentDirection == RTPTransceiverDirectionSendrecv || currentDirection == RTPTransceiverDirectionSendonly) {
|
||||
currentDirection != RTPTransceiverDirectionSendrecv && currentDirection != RTPTransceiverDirectionSendonly {
|
||||
sender, err := pc.api.NewRTPSender(track, pc.dtlsTransport)
|
||||
if err == nil {
|
||||
err = transceiver.SetSender(sender, track)
|
||||
|
@@ -78,20 +78,14 @@ func TestPeerConnection_Close_PreICE(t *testing.T) {
|
||||
|
||||
assert.NoError(t, pcAnswer.SetRemoteDescription(answer))
|
||||
|
||||
for {
|
||||
if pcAnswer.iceTransport.State() == ICETransportStateChecking {
|
||||
break
|
||||
}
|
||||
for pcAnswer.iceTransport.State() != ICETransportStateChecking {
|
||||
time.Sleep(time.Second / 4)
|
||||
}
|
||||
|
||||
assert.NoError(t, pcAnswer.Close())
|
||||
|
||||
// Assert that ICETransport is shutdown, test timeout will prevent deadlock
|
||||
for {
|
||||
if pcAnswer.iceTransport.State() == ICETransportStateClosed {
|
||||
return
|
||||
}
|
||||
for pcAnswer.iceTransport.State() != ICETransportStateClosed {
|
||||
time.Sleep(time.Second / 4)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user