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

Unified Diff: webrtc/modules/audio_coding/acm2/audio_coding_module.cc

Issue 2997763002: [MERGE TO 61] Fix incorrect memset on muted frames. (Closed)
Patch Set: Created 3 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/acm2/audio_coding_module.cc
diff --git a/webrtc/modules/audio_coding/acm2/audio_coding_module.cc b/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
index be8b1d91d861b73f747aa433f8f84fdeb6ede4b6..14958181859501459181f56380e79bf885e40376 100644
--- a/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
+++ b/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
@@ -10,6 +10,8 @@
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
+#include <algorithm>
+
#include "webrtc/api/audio_codecs/builtin_audio_decoder_factory.h"
#include "webrtc/modules/audio_coding/acm2/acm_receiver.h"
#include "webrtc/modules/audio_coding/acm2/acm_resampler.h"
@@ -335,7 +337,7 @@ int DownMix(const AudioFrame& frame,
static_cast<int32_t>(frame_data[2 * n + 1])) >> 1);
}
} else {
- memset(out_buff, 0, frame.samples_per_channel_);
+ std::fill(out_buff, out_buff + frame.samples_per_channel_, 0);
}
return 0;
}
@@ -354,7 +356,7 @@ int UpMix(const AudioFrame& frame, size_t length_out_buff, int16_t* out_buff) {
out_buff[2 * i] = sample;
}
} else {
- memset(out_buff, 0, 2 * frame.samples_per_channel_);
+ std::fill(out_buff, out_buff + frame.samples_per_channel_ * 2, 0);
}
return 0;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698