Don't add nack if it is already present in track codec (#1714)

This commit is contained in:
cnderrauber
2023-05-17 18:48:54 +08:00
committed by GitHub
parent 9395f0b1fb
commit 1c88a03366
+10 -1
View File
@@ -1958,7 +1958,16 @@ func configureAudioTransceiver(tr *webrtc.RTPTransceiver, stereo bool, nack bool
c.SDPFmtpLine += ";sprop-stereo=1"
}
if nack {
c.RTCPFeedback = append(c.RTCPFeedback, webrtc.RTCPFeedback{Type: webrtc.TypeRTCPFBNACK})
var nackFound bool
for _, fb := range c.RTCPFeedback {
if fb.Type == webrtc.TypeRTCPFBNACK {
nackFound = true
break
}
}
if !nackFound {
c.RTCPFeedback = append(c.RTCPFeedback, webrtc.RTCPFeedback{Type: webrtc.TypeRTCPFBNACK})
}
}
}
configCodecs = append(configCodecs, c)