From 3088941a5efc2ec4b7c29a11fbac36092a20f170 Mon Sep 17 00:00:00 2001 From: Tommi Date: Mon, 24 Jan 2022 14:04:55 +0100 Subject: [PATCH] Minor order change to Call::DestroyVideoSendStream. Move StopPermanentlyAndGetRtpStates closer to being the last step of the destruction process. Bug: webrtc:11993 Change-Id: I83d86c505b05f5c10d0ce802494baba9aa645027 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239182 Auto-Submit: Tomas Gunnarsson Reviewed-by: Niels Moller Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/main@{#35774} --- call/call.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/call/call.cc b/call/call.cc index d34b9d3d73..d86acdf263 100644 --- a/call/call.cc +++ b/call/call.cc @@ -1080,10 +1080,6 @@ void Call::DestroyVideoSendStream(webrtc::VideoSendStream* send_stream) { VideoSendStream* send_stream_impl = static_cast(send_stream); - VideoSendStream::RtpStateMap rtp_states; - VideoSendStream::RtpPayloadStateMap rtp_payload_states; - send_stream_impl->StopPermanentlyAndGetRtpStates(&rtp_states, - &rtp_payload_states); auto it = video_send_ssrcs_.begin(); while (it != video_send_ssrcs_.end()) { @@ -1103,6 +1099,10 @@ void Call::DestroyVideoSendStream(webrtc::VideoSendStream* send_stream) { if (video_send_streams_.empty()) video_send_streams_empty_.store(true, std::memory_order_relaxed); + VideoSendStream::RtpStateMap rtp_states; + VideoSendStream::RtpPayloadStateMap rtp_payload_states; + send_stream_impl->StopPermanentlyAndGetRtpStates(&rtp_states, + &rtp_payload_states); for (const auto& kv : rtp_states) { suspended_video_send_ssrcs_[kv.first] = kv.second; }