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

Unified Diff: webrtc/modules/audio_processing/aec/aec_resampler.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
« no previous file with comments | « webrtc/modules/audio_processing/aec/aec_core.cc ('k') | webrtc/modules/audio_processing/aecm/aecm_core.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/aec/aec_resampler.cc
diff --git a/webrtc/modules/audio_processing/aec/aec_resampler.cc b/webrtc/modules/audio_processing/aec/aec_resampler.cc
index cc9046bd43a78e721939695d75324577f826e515..2fde934d99c880e2d8d45f1f2633cce9c6c82f54 100644
--- a/webrtc/modules/audio_processing/aec/aec_resampler.cc
+++ b/webrtc/modules/audio_processing/aec/aec_resampler.cc
@@ -14,11 +14,11 @@
#include "webrtc/modules/audio_processing/aec/aec_resampler.h"
-#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
+#include "webrtc/base/checks.h"
#include "webrtc/modules/audio_processing/aec/aec_core.h"
namespace webrtc {
@@ -74,11 +74,11 @@ void WebRtcAec_ResampleLinear(void* resampInst,
float be, tnew;
size_t tn, mm;
- assert(size <= 2 * FRAME_LEN);
- assert(resampInst != NULL);
- assert(inspeech != NULL);
- assert(outspeech != NULL);
- assert(size_out != NULL);
+ RTC_DCHECK_LE(size, 2u * FRAME_LEN);
+ RTC_DCHECK(resampInst);
+ RTC_DCHECK(inspeech);
+ RTC_DCHECK(outspeech);
+ RTC_DCHECK(size_out);
// Add new frame data in lookahead
memcpy(&obj->buffer[FRAME_LEN + kResamplingDelay], inspeech,
@@ -163,7 +163,7 @@ int EstimateSkew(const int* rawSkew,
if (n == 0) {
return -1;
}
- assert(n > 0);
+ RTC_DCHECK_GT(n, 0);
rawAvg /= n;
for (i = 0; i < size; i++) {
@@ -172,7 +172,7 @@ int EstimateSkew(const int* rawSkew,
rawAbsDev += err >= 0 ? err : -err;
}
}
- assert(n > 0);
+ RTC_DCHECK_GT(n, 0);
rawAbsDev /= n;
upperLimit = static_cast<int>(rawAvg + 5 * rawAbsDev + 1); // +1 for ceiling.
lowerLimit = static_cast<int>(rawAvg - 5 * rawAbsDev - 1); // -1 for floor.
@@ -193,7 +193,7 @@ int EstimateSkew(const int* rawSkew,
if (n == 0) {
return -1;
}
- assert(n > 0);
+ RTC_DCHECK_GT(n, 0);
xAvg = x / n;
denom = x2 - xAvg * x;
« no previous file with comments | « webrtc/modules/audio_processing/aec/aec_core.cc ('k') | webrtc/modules/audio_processing/aecm/aecm_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698