Chromium Code Reviews| Index: webrtc/voice_engine/utility.cc |
| diff --git a/webrtc/voice_engine/utility.cc b/webrtc/voice_engine/utility.cc |
| index 605e55369e3d4a31666e17bf69d3b04ccd054630..3a5ea86bec97299b140955372987ccc2dbd1411d 100644 |
| --- a/webrtc/voice_engine/utility.cc |
| +++ b/webrtc/voice_engine/utility.cc |
| @@ -10,6 +10,7 @@ |
| #include "webrtc/voice_engine/utility.h" |
| +#include "webrtc/base/checks.h" |
| #include "webrtc/base/logging.h" |
| #include "webrtc/common_audio/resampler/include/push_resampler.h" |
| #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h" |
| @@ -52,21 +53,19 @@ void RemixAndResample(const int16_t* src_data, |
| if (resampler->InitializeIfNeeded(sample_rate_hz, dst_frame->sample_rate_hz_, |
| audio_ptr_num_channels) == -1) { |
| - LOG(LS_ERROR) << "InitializeIfNeeded failed: sample_rate_hz = " |
| - << sample_rate_hz << ", dst_frame->sample_rate_hz_ = " |
| - << dst_frame->sample_rate_hz_ |
| - << ", audio_ptr_num_channels = " << audio_ptr_num_channels; |
| - assert(false); |
| + RTC_CHECK(false) << "InitializeIfNeeded failed: sample_rate_hz = " |
|
hlundin-webrtc
2016/05/24 06:38:03
Consider FATAL().
tommi
2016/05/24 07:49:13
Done.
|
| + << sample_rate_hz << ", dst_frame->sample_rate_hz_ = " |
| + << dst_frame->sample_rate_hz_ |
| + << ", audio_ptr_num_channels = " << audio_ptr_num_channels; |
| } |
| const size_t src_length = samples_per_channel * audio_ptr_num_channels; |
| int out_length = resampler->Resample(audio_ptr, src_length, dst_frame->data_, |
| AudioFrame::kMaxDataSizeSamples); |
| if (out_length == -1) { |
| - LOG(LS_ERROR) << "Resample failed: audio_ptr = " << audio_ptr |
| - << ", src_length = " << src_length |
| - << ", dst_frame->data_ = " << dst_frame->data_; |
| - assert(false); |
| + RTC_CHECK(false) << "Resample failed: audio_ptr = " << audio_ptr |
|
hlundin-webrtc
2016/05/24 06:38:03
And here.
tommi
2016/05/24 07:49:13
Done.
|
| + << ", src_length = " << src_length |
| + << ", dst_frame->data_ = " << dst_frame->data_; |
| } |
| dst_frame->samples_per_channel_ = out_length / audio_ptr_num_channels; |
| @@ -84,8 +83,8 @@ void MixWithSat(int16_t target[], |
| const int16_t source[], |
| size_t source_channel, |
| size_t source_len) { |
| - assert(target_channel == 1 || target_channel == 2); |
| - assert(source_channel == 1 || source_channel == 2); |
| + RTC_DCHECK(target_channel == 1 || target_channel == 2); |
|
hlundin-webrtc
2016/05/24 06:38:03
Consider rewriting these as
RTC_DCHECK_GE(target_c
tommi
2016/05/24 07:49:13
Done.
|
| + RTC_DCHECK(source_channel == 1 || source_channel == 2); |
| if (target_channel == 2 && source_channel == 1) { |
| // Convert source from mono to stereo. |