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); }