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

Unified Diff: webrtc/modules/audio_processing/agc/loudness_histogram.cc

Issue 2320053003: webrtc/modules/audio_processing: Use RTC_DCHECK() instead of assert() (Closed)
Patch Set: rebase Created 4 years, 3 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_processing/agc/loudness_histogram.cc
diff --git a/webrtc/modules/audio_processing/agc/loudness_histogram.cc b/webrtc/modules/audio_processing/agc/loudness_histogram.cc
index 05b6b323defbe98ca45599083be09e7e3b8756c2..9112fbbe800de84c715c3bd52733d9555c2f6ce0 100644
--- a/webrtc/modules/audio_processing/agc/loudness_histogram.cc
+++ b/webrtc/modules/audio_processing/agc/loudness_histogram.cc
@@ -13,6 +13,7 @@
#include <cmath>
#include <cstring>
+#include "webrtc/base/checks.h"
#include "webrtc/modules/include/module_common_types.h"
namespace webrtc {
@@ -101,7 +102,7 @@ void LoudnessHistogram::Update(double rms, double activity_probaility) {
// Doing nothing if buffer is not full, yet.
void LoudnessHistogram::RemoveOldestEntryAndUpdate() {
- assert(len_circular_buffer_ > 0);
+ RTC_DCHECK_GT(len_circular_buffer_, 0);
// Do nothing if circular buffer is not full.
if (!buffer_is_full_)
return;
@@ -114,7 +115,7 @@ void LoudnessHistogram::RemoveOldestEntryAndUpdate() {
void LoudnessHistogram::RemoveTransient() {
// Don't expect to be here if high-activity region is longer than
// |kTransientWidthThreshold| or there has not been any transient.
- assert(len_high_activity_ <= kTransientWidthThreshold);
+ RTC_DCHECK_LE(len_high_activity_, kTransientWidthThreshold);
int index =
(buffer_index_ > 0) ? (buffer_index_ - 1) : len_circular_buffer_ - 1;
while (len_high_activity_ > 0) {
« no previous file with comments | « webrtc/modules/audio_processing/agc/agc_manager_direct.cc ('k') | webrtc/modules/audio_processing/audio_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698