Bail out early if the RTP send module for a SSRC was not found
since it might have been deregistered previously. BUG=chromium:1454860,chromium:1459124 Change-Id: I70ba43265361d040e568f83b6400ff8f3c2a8e98 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311800 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Philipp Hancke <phancke@microsoft.com> Cr-Commit-Position: refs/heads/main@{#40431}
This commit is contained in:
parent
94abc09246
commit
c0ed83eac2
@ -88,7 +88,10 @@ void PacketRouter::AddSendRtpModuleToMap(RtpRtcpInterface* rtp_module,
|
||||
void PacketRouter::RemoveSendRtpModuleFromMap(uint32_t ssrc) {
|
||||
RTC_DCHECK_RUN_ON(&thread_checker_);
|
||||
auto it = send_modules_map_.find(ssrc);
|
||||
RTC_DCHECK(it != send_modules_map_.end());
|
||||
if (it == send_modules_map_.end()) {
|
||||
RTC_LOG(LS_ERROR) << "No send module found for ssrc " << ssrc;
|
||||
return;
|
||||
}
|
||||
send_modules_list_.remove(it->second);
|
||||
RTC_CHECK(modules_used_in_current_batch_.empty());
|
||||
send_modules_map_.erase(it);
|
||||
|
||||
@ -541,12 +541,6 @@ TEST_F(PacketRouterDeathTest, DoubleRegistrationOfReceiveModuleDisallowed) {
|
||||
packet_router_.RemoveReceiveRtpModule(&module);
|
||||
}
|
||||
|
||||
TEST_F(PacketRouterDeathTest, RemovalOfNeverAddedSendModuleDisallowed) {
|
||||
NiceMock<MockRtpRtcpInterface> module;
|
||||
|
||||
EXPECT_DEATH(packet_router_.RemoveSendRtpModule(&module), "");
|
||||
}
|
||||
|
||||
TEST_F(PacketRouterDeathTest, RemovalOfNeverAddedReceiveModuleDisallowed) {
|
||||
NiceMock<MockRtpRtcpInterface> module;
|
||||
|
||||
@ -554,6 +548,18 @@ TEST_F(PacketRouterDeathTest, RemovalOfNeverAddedReceiveModuleDisallowed) {
|
||||
}
|
||||
#endif // RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
|
||||
|
||||
TEST_F(PacketRouterTest, RemovalOfNeverAddedSendModuleIgnored) {
|
||||
NiceMock<MockRtpRtcpInterface> module;
|
||||
packet_router_.RemoveSendRtpModule(&module);
|
||||
}
|
||||
|
||||
TEST_F(PacketRouterTest, DuplicateRemovalOfSendModuleIgnored) {
|
||||
NiceMock<MockRtpRtcpInterface> module;
|
||||
packet_router_.AddSendRtpModule(&module, false);
|
||||
packet_router_.RemoveSendRtpModule(&module);
|
||||
packet_router_.RemoveSendRtpModule(&module);
|
||||
}
|
||||
|
||||
TEST(PacketRouterRembTest, ChangeSendRtpModuleChangeRembSender) {
|
||||
rtc::ScopedFakeClock clock;
|
||||
NiceMock<MockRtpRtcpInterface> rtp_send;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user