Migrate modules/audio_coding, audio_mixer/ and audio_processing/ to webrtc::Mutex.
Bug: webrtc:11567
Change-Id: I03b78bd2e411e9bcca199f85e4457511826cd17e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176745
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31649}
diff --git a/modules/audio_coding/acm2/acm_receiver.cc b/modules/audio_coding/acm2/acm_receiver.cc
index 29eff19..33142c7 100644
--- a/modules/audio_coding/acm2/acm_receiver.cc
+++ b/modules/audio_coding/acm2/acm_receiver.cc
@@ -86,7 +86,7 @@
}
absl::optional<int> AcmReceiver::last_packet_sample_rate_hz() const {
- rtc::CritScope lock(&crit_sect_);
+ MutexLock lock(&mutex_);
if (!last_decoder_) {
return absl::nullopt;
}
@@ -118,7 +118,7 @@
}
{
- rtc::CritScope lock(&crit_sect_);
+ MutexLock lock(&mutex_);
if (absl::EqualsIgnoreCase(format->sdp_format.name, "cn")) {
if (last_decoder_ && last_decoder_->num_channels > 1) {
// This is a CNG and the audio codec is not mono, so skip pushing in
@@ -131,7 +131,7 @@
/*num_channels=*/format->num_channels,
/*sdp_format=*/std::move(format->sdp_format)};
}
- } // |crit_sect_| is released.
+ } // |mutex_| is released.
if (neteq_->InsertPacket(rtp_header, incoming_payload) < 0) {
RTC_LOG(LERROR) << "AcmReceiver::InsertPacket "
@@ -147,7 +147,7 @@
bool* muted) {
RTC_DCHECK(muted);
// Accessing members, take the lock.
- rtc::CritScope lock(&crit_sect_);
+ MutexLock lock(&mutex_);
if (neteq_->GetAudio(audio_frame, muted) != NetEq::kOK) {
RTC_LOG(LERROR) << "AcmReceiver::GetAudio - NetEq Failed.";
@@ -217,7 +217,7 @@
}
void AcmReceiver::RemoveAllCodecs() {
- rtc::CritScope lock(&crit_sect_);
+ MutexLock lock(&mutex_);
neteq_->RemoveAllPayloadTypes();
last_decoder_ = absl::nullopt;
}
@@ -236,7 +236,7 @@
absl::optional<std::pair<int, SdpAudioFormat>> AcmReceiver::LastDecoder()
const {
- rtc::CritScope lock(&crit_sect_);
+ MutexLock lock(&mutex_);
if (!last_decoder_) {
return absl::nullopt;
}
@@ -327,7 +327,7 @@
void AcmReceiver::GetDecodingCallStatistics(
AudioDecodingCallStats* stats) const {
- rtc::CritScope lock(&crit_sect_);
+ MutexLock lock(&mutex_);
*stats = call_stats_.GetDecodingStatistics();
}