In RtcpTransceiver avoid extra PostTask during construction

it is not required because during construction members can be set on
wrong thread, and in some corner cases it may even cause a crash.

Bug: none
Change-Id: I37d7f2a7772b6ab5e574077d3f53bca2529f9ae1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222651
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34315}
This commit is contained in:
Danil Chapovalov
2021-06-16 17:43:00 +02:00
committed by WebRTC LUCI CQ
parent f9d5e55a31
commit 35b21ba8d4
2 changed files with 20 additions and 3 deletions

View File

@ -92,9 +92,7 @@ RtcpTransceiverImpl::RtcpTransceiverImpl(const RtcpTransceiverConfig& config)
: config_(config), ready_to_send_(config.initial_ready_to_send) {
RTC_CHECK(config_.Validate());
if (ready_to_send_ && config_.schedule_periodic_compound_packets) {
config_.task_queue->PostTask(ToQueuedTask([this] {
SchedulePeriodicCompoundPackets(config_.initial_report_delay_ms);
}));
SchedulePeriodicCompoundPackets(config_.initial_report_delay_ms);
}
}