Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: webrtc/modules/audio_coding/codecs/opus/interface/audio_encoder_opus.h

Issue 1176303004: Fix a data race in AudioEncoderMutableImpl and derived classes (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Return config_ by value instead of reference Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/codecs/opus/interface/audio_encoder_opus.h
diff --git a/webrtc/modules/audio_coding/codecs/opus/interface/audio_encoder_opus.h b/webrtc/modules/audio_coding/codecs/opus/interface/audio_encoder_opus.h
index 7dca1fda25994eca3a2e6ae4954ecf751e24fb5f..4de4e26273f98d3fa077c286eb008d185711f6cb 100644
--- a/webrtc/modules/audio_coding/codecs/opus/interface/audio_encoder_opus.h
+++ b/webrtc/modules/audio_coding/codecs/opus/interface/audio_encoder_opus.h
@@ -93,10 +93,17 @@ class AudioEncoderMutableOpus
bool SetApplication(Application application) override;
bool SetMaxPlaybackRate(int frequency_hz) override;
AudioEncoderOpus::ApplicationMode application() const {
+ CriticalSectionScoped cs(encoder_lock_.get());
return encoder()->application();
}
- double packet_loss_rate() const { return encoder()->packet_loss_rate(); }
- bool dtx_enabled() const { return encoder()->dtx_enabled(); }
+ double packet_loss_rate() const {
+ CriticalSectionScoped cs(encoder_lock_.get());
+ return encoder()->packet_loss_rate();
+ }
+ bool dtx_enabled() const {
+ CriticalSectionScoped cs(encoder_lock_.get());
+ return encoder()->dtx_enabled();
+ }
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698