diff --git a/media/mtransport/third_party/nICEr/src/ice/ice_component.c b/media/mtransport/third_party/nICEr/src/ice/ice_component.c index bc0dc2e6c187..3727a1e659de 100644 --- a/media/mtransport/third_party/nICEr/src/ice/ice_component.c +++ b/media/mtransport/third_party/nICEr/src/ice/ice_component.c @@ -1359,6 +1359,10 @@ static void nr_ice_component_consent_timer_cb(NR_SOCKET s, int how, void *cb_arg nr_ice_component *comp=cb_arg; int r; + if (!comp->consent_ctx) { + return; + } + if (comp->consent_timer) { NR_async_timer_cancel(comp->consent_timer); } diff --git a/media/mtransport/third_party/nICEr/src/ice/ice_media_stream.c b/media/mtransport/third_party/nICEr/src/ice/ice_media_stream.c index aaaafde581d5..f9e5915766dc 100644 --- a/media/mtransport/third_party/nICEr/src/ice/ice_media_stream.c +++ b/media/mtransport/third_party/nICEr/src/ice/ice_media_stream.c @@ -592,9 +592,7 @@ void nr_ice_media_stream_refresh_consent_all(nr_ice_media_stream *stream) comp=STAILQ_FIRST(&stream->components); while(comp){ - if((comp->state != NR_ICE_COMPONENT_DISABLED) && - (comp->local_component->state != NR_ICE_COMPONENT_DISABLED) && - comp->disconnected) { + if(comp->disconnected) { nr_ice_component_refresh_consent_now(comp); } @@ -608,10 +606,7 @@ void nr_ice_media_stream_disconnect_all_components(nr_ice_media_stream *stream) comp=STAILQ_FIRST(&stream->components); while(comp){ - if((comp->state != NR_ICE_COMPONENT_DISABLED) && - (comp->local_component->state != NR_ICE_COMPONENT_DISABLED)) { - comp->disconnected = 1; - } + comp->disconnected = 1; comp=STAILQ_NEXT(comp,entry); } @@ -731,6 +726,9 @@ int nr_ice_media_stream_component_failed(nr_ice_media_stream *stream,nr_ice_comp stream->timer=0; } + /* Cancel consent timers in case it is running already */ + nr_ice_component_consent_destroy(component); + if (stream->pctx->handler) { stream->pctx->handler->vtbl->stream_failed(stream->pctx->handler->obj,stream->local_stream); }