From 28ea9ba80d1a61f829542bdb715c70f810daaf14 Mon Sep 17 00:00:00 2001 From: Markus Handell Date: Thu, 23 Nov 2023 13:40:23 +0100 Subject: [PATCH] VideoStreamEncoder: remove an unneeded and potentially dangerous PostTask. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: None Change-Id: I9423a78787db09469faa31646e97ac8904a2b32a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327782 Reviewed-by: Ilya Nikolaevskiy Reviewed-by: Erik Språng Reviewed-by: Ilya Nikolaevskiy Commit-Queue: Markus Handell Cr-Commit-Position: refs/heads/main@{#41224} --- video/video_stream_encoder.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc index 2e5a120eed..c5929efce5 100644 --- a/video/video_stream_encoder.cc +++ b/video/video_stream_encoder.cc @@ -1538,11 +1538,8 @@ void VideoStreamEncoder::OnFrame(Timestamp post_time, << incoming_frame.ntp_time_ms() << " <= " << last_captured_timestamp_ << ") for incoming frame. Dropping."; - encoder_queue_.PostTask([this, incoming_frame]() { - RTC_DCHECK_RUN_ON(&encoder_queue_); - accumulated_update_rect_.Union(incoming_frame.update_rect()); - accumulated_update_rect_is_valid_ &= incoming_frame.has_update_rect(); - }); + accumulated_update_rect_.Union(incoming_frame.update_rect()); + accumulated_update_rect_is_valid_ &= incoming_frame.has_update_rect(); return; }