| Index: webrtc/modules/audio_processing/test/audioproc_float.cc
|
| diff --git a/webrtc/modules/audio_processing/test/audioproc_float.cc b/webrtc/modules/audio_processing/test/audioproc_float.cc
|
| index d2983b2c56d2f6d99e21449f90a0ad70dd949f4f..9da4e7574c3277e9b007bcc8832e259d99b0384e 100644
|
| --- a/webrtc/modules/audio_processing/test/audioproc_float.cc
|
| +++ b/webrtc/modules/audio_processing/test/audioproc_float.cc
|
| @@ -14,6 +14,7 @@
|
|
|
| #include "gflags/gflags.h"
|
| #include "webrtc/base/checks.h"
|
| +#include "webrtc/base/format_macros.h"
|
| #include "webrtc/base/scoped_ptr.h"
|
| #include "webrtc/common_audio/channel_buffer.h"
|
| #include "webrtc/common_audio/wav_file.h"
|
| @@ -23,10 +24,20 @@
|
| #include "webrtc/system_wrappers/interface/tick_util.h"
|
| #include "webrtc/test/testsupport/trace_to_stderr.h"
|
|
|
| +namespace {
|
| +
|
| +bool ValidateOutChannels(const char* flagname, int32_t value) {
|
| + return value >= 0;
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| DEFINE_string(dump, "", "The name of the debug dump file to read from.");
|
| DEFINE_string(i, "", "The name of the input file to read from.");
|
| DEFINE_string(o, "out.wav", "Name of the output file to write to.");
|
| DEFINE_int32(out_channels, 0, "Number of output channels. Defaults to input.");
|
| +const bool out_channels_dummy =
|
| + google::RegisterFlagValidator(&FLAGS_out_channels, &ValidateOutChannels);
|
| DEFINE_int32(out_sample_rate, 0,
|
| "Output sample rate in Hz. Defaults to input.");
|
| DEFINE_string(mic_positions, "",
|
| @@ -77,8 +88,8 @@ int main(int argc, char* argv[]) {
|
| test::TraceToStderr trace_to_stderr(true);
|
| WavReader in_file(FLAGS_i);
|
| // If the output format is uninitialized, use the input format.
|
| - const int out_channels =
|
| - FLAGS_out_channels ? FLAGS_out_channels : in_file.num_channels();
|
| + const size_t out_channels = FLAGS_out_channels ?
|
| + static_cast<size_t>(FLAGS_out_channels) : in_file.num_channels();
|
| const int out_sample_rate =
|
| FLAGS_out_sample_rate ? FLAGS_out_sample_rate : in_file.sample_rate();
|
| WavWriter out_file(FLAGS_o, out_sample_rate, out_channels);
|
| @@ -110,9 +121,9 @@ int main(int argc, char* argv[]) {
|
| CHECK_EQ(kNoErr, ap->noise_suppression()->set_level(
|
| static_cast<NoiseSuppression::Level>(FLAGS_ns_level)));
|
|
|
| - printf("Input file: %s\nChannels: %d, Sample rate: %d Hz\n\n",
|
| + printf("Input file: %s\nChannels: %" PRIuS ", Sample rate: %d Hz\n\n",
|
| FLAGS_i.c_str(), in_file.num_channels(), in_file.sample_rate());
|
| - printf("Output file: %s\nChannels: %d, Sample rate: %d Hz\n\n",
|
| + printf("Output file: %s\nChannels: %" PRIuS ", Sample rate: %d Hz\n\n",
|
| FLAGS_o.c_str(), out_file.num_channels(), out_file.sample_rate());
|
|
|
| ChannelBuffer<float> in_buf(
|
|
|