Exclude ice restart case from offer answer id mismatch warning (#4341)

This commit is contained in:
cnderrauber
2026-03-05 13:05:37 +08:00
committed by GitHub
parent 303657bcdf
commit b35105656c
+7 -5
View File
@@ -2604,11 +2604,13 @@ func (t *PCTransport) createAndSendOffer(options *webrtc.OfferOptions) error {
remoteAnswerId := t.remoteAnswerId.Load() remoteAnswerId := t.remoteAnswerId.Load()
if remoteAnswerId != 0 && remoteAnswerId != t.localOfferId.Load() { if remoteAnswerId != 0 && remoteAnswerId != t.localOfferId.Load() {
t.params.Logger.Warnw( if options == nil || !options.ICERestart {
"sdp state: sending offer before receiving answer", nil, t.params.Logger.Warnw(
"localOfferId", t.localOfferId.Load(), "sdp state: sending offer before receiving answer", nil,
"remoteAnswerId", remoteAnswerId, "localOfferId", t.localOfferId.Load(),
) "remoteAnswerId", remoteAnswerId,
)
}
} }
if err := t.params.Handler.OnOffer(offer, t.localOfferId.Inc(), t.getMidToTrackIDMapping()); err != nil { if err := t.params.Handler.OnOffer(offer, t.localOfferId.Inc(), t.getMidToTrackIDMapping()); err != nil {