From b35105656caa1edc6aa15f04cd94ef9aba4702bd Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Thu, 5 Mar 2026 13:05:37 +0800 Subject: [PATCH] Exclude ice restart case from offer answer id mismatch warning (#4341) --- pkg/rtc/transport.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/rtc/transport.go b/pkg/rtc/transport.go index 1c0190702..dbc48ac21 100644 --- a/pkg/rtc/transport.go +++ b/pkg/rtc/transport.go @@ -2604,11 +2604,13 @@ func (t *PCTransport) createAndSendOffer(options *webrtc.OfferOptions) error { remoteAnswerId := t.remoteAnswerId.Load() if remoteAnswerId != 0 && remoteAnswerId != t.localOfferId.Load() { - t.params.Logger.Warnw( - "sdp state: sending offer before receiving answer", nil, - "localOfferId", t.localOfferId.Load(), - "remoteAnswerId", remoteAnswerId, - ) + if options == nil || !options.ICERestart { + t.params.Logger.Warnw( + "sdp state: sending offer before receiving answer", nil, + "localOfferId", t.localOfferId.Load(), + "remoteAnswerId", remoteAnswerId, + ) + } } if err := t.params.Handler.OnOffer(offer, t.localOfferId.Inc(), t.getMidToTrackIDMapping()); err != nil {