From da06e8f6bdb7bda271d9e68300f42e769d896542 Mon Sep 17 00:00:00 2001 From: Per Kjellander Date: Thu, 7 Jan 2021 19:37:00 +0100 Subject: [PATCH] Do not proxy VideoSendStreamImpl::OnVideoLayersAllocationUpdated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OnVideoLayersAllocationUpdated is handled on the encoder task queue in order to not race with OnEncodedImage callbacks. Bug: webrtc:12000 Change-Id: I1c9a450cce819a7a0f8827aa0bb675c37350a0c2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/200880 Reviewed-by: Erik Språng Commit-Queue: Per Kjellander Cr-Commit-Position: refs/heads/master@{#32935} --- video/video_send_stream_impl.cc | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/video/video_send_stream_impl.cc b/video/video_send_stream_impl.cc index 7eca3a093e..aeb197c223 100644 --- a/video/video_send_stream_impl.cc +++ b/video/video_send_stream_impl.cc @@ -481,15 +481,8 @@ void VideoSendStreamImpl::OnBitrateAllocationUpdated( void VideoSendStreamImpl::OnVideoLayersAllocationUpdated( VideoLayersAllocation allocation) { - if (!worker_queue_->IsCurrent()) { - auto ptr = weak_ptr_; - worker_queue_->PostTask([allocation = std::move(allocation), ptr] { - if (!ptr.get()) - return; - ptr->OnVideoLayersAllocationUpdated(allocation); - }); - return; - } + // OnVideoLayersAllocationUpdated is handled on the encoder task queue in + // order to not race with OnEncodedImage callbacks. rtp_video_sender_->OnVideoLayersAllocationUpdated(allocation); }