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

Unified Diff: webrtc/modules/audio_mixer/audio_mixer_impl.cc

Issue 2439283002: Elimiteted race condition in the AudioMixer. (Closed)
Patch Set: Removed previous change, now holding lock a little longer. Created 4 years, 2 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
« no previous file with comments | « webrtc/modules/audio_mixer/audio_mixer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_mixer/audio_mixer_impl.cc
diff --git a/webrtc/modules/audio_mixer/audio_mixer_impl.cc b/webrtc/modules/audio_mixer/audio_mixer_impl.cc
index c646fcb56c22797de18c2cf68d81dd04bfcb36db..a7af8c33d74a85df86a237cb299f5dcd12ce97d0 100644
--- a/webrtc/modules/audio_mixer/audio_mixer_impl.cc
+++ b/webrtc/modules/audio_mixer/audio_mixer_impl.cc
@@ -200,22 +200,22 @@ void AudioMixerImpl::Mix(int sample_rate,
{
rtc::CritScope lock(&crit_);
mix_list = GetAudioFromSources();
- }
- for (const auto& frame : mix_list) {
- RemixFrame(number_of_channels, frame);
- }
+ for (const auto& frame : mix_list) {
+ RemixFrame(number_of_channels, frame);
+ }
- audio_frame_for_mixing->UpdateFrame(
- -1, time_stamp_, NULL, 0, OutputFrequency(), AudioFrame::kNormalSpeech,
- AudioFrame::kVadPassive, number_of_channels);
+ audio_frame_for_mixing->UpdateFrame(
+ -1, time_stamp_, NULL, 0, OutputFrequency(), AudioFrame::kNormalSpeech,
+ AudioFrame::kVadPassive, number_of_channels);
- time_stamp_ += static_cast<uint32_t>(sample_size_);
+ time_stamp_ += static_cast<uint32_t>(sample_size_);
- use_limiter_ = mix_list.size() > 1;
+ use_limiter_ = mix_list.size() > 1;
- // We only use the limiter if we're actually mixing multiple streams.
- MixFromList(audio_frame_for_mixing, mix_list, use_limiter_);
+ // We only use the limiter if we're actually mixing multiple streams.
+ MixFromList(audio_frame_for_mixing, mix_list, use_limiter_);
+ }
if (audio_frame_for_mixing->samples_per_channel_ == 0) {
// Nothing was mixed, set the audio samples to silence.
« no previous file with comments | « webrtc/modules/audio_mixer/audio_mixer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698