From 26ce03e469eb11cfd84d4f97e774911817ffd61e Mon Sep 17 00:00:00 2001 From: Tim Na Date: Mon, 16 Nov 2020 14:45:44 -0800 Subject: [PATCH] Locating input audio level before TaskQueue. - TaskQueue needs to be destroyed at last to avoid thread race condition. Bug: webrtc:12111 Change-Id: Ibfc96e2ebd71a2aa8d1ac8c83038d256bac0e600 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/193780 Reviewed-by: Sam Zackrisson Commit-Queue: Sam Zackrisson Cr-Commit-Position: refs/heads/master@{#32624} --- audio/voip/audio_egress.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/audio/voip/audio_egress.h b/audio/voip/audio_egress.h index d9ae4f3e04..fcd9ed0f20 100644 --- a/audio/voip/audio_egress.h +++ b/audio/voip/audio_egress.h @@ -130,6 +130,9 @@ class AudioEgress : public AudioSender, public AudioPacketizationCallback { // Synchronization is handled internally by AudioCodingModule. const std::unique_ptr audio_coding_; + // Synchronization is handled internally by voe::AudioLevel. + voe::AudioLevel input_audio_level_; + // Struct that holds all variables used by encoder task queue. struct EncoderContext { // Offset used to mark rtp timestamp in sample rate unit in @@ -148,9 +151,6 @@ class AudioEgress : public AudioSender, public AudioPacketizationCallback { // Defined last to ensure that there are no running tasks when the other // members are destroyed. rtc::TaskQueue encoder_queue_; - - // Synchronizaton is handled internally by voe::AudioLevel. - voe::AudioLevel input_audio_level_; }; } // namespace webrtc