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

Side by Side Diff: webrtc/modules/audio_processing/test/unpack.cc

Issue 1534193008: Misc. small cleanups (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Unnecessary parens Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 if (argc < 2) { 70 if (argc < 2) {
71 printf("%s", google::ProgramUsage()); 71 printf("%s", google::ProgramUsage());
72 return 1; 72 return 1;
73 } 73 }
74 74
75 FILE* debug_file = OpenFile(argv[1], "rb"); 75 FILE* debug_file = OpenFile(argv[1], "rb");
76 76
77 Event event_msg; 77 Event event_msg;
78 int frame_count = 0; 78 int frame_count = 0;
79 int reverse_samples_per_channel = 0; 79 size_t reverse_samples_per_channel = 0;
80 int input_samples_per_channel = 0; 80 size_t input_samples_per_channel = 0;
81 int output_samples_per_channel = 0; 81 size_t output_samples_per_channel = 0;
82 int num_reverse_channels = 0; 82 int num_reverse_channels = 0;
83 int num_input_channels = 0; 83 int num_input_channels = 0;
84 int num_output_channels = 0; 84 int num_output_channels = 0;
85 rtc::scoped_ptr<WavWriter> reverse_wav_file; 85 rtc::scoped_ptr<WavWriter> reverse_wav_file;
86 rtc::scoped_ptr<WavWriter> input_wav_file; 86 rtc::scoped_ptr<WavWriter> input_wav_file;
87 rtc::scoped_ptr<WavWriter> output_wav_file; 87 rtc::scoped_ptr<WavWriter> output_wav_file;
88 rtc::scoped_ptr<RawFile> reverse_raw_file; 88 rtc::scoped_ptr<RawFile> reverse_raw_file;
89 rtc::scoped_ptr<RawFile> input_raw_file; 89 rtc::scoped_ptr<RawFile> input_raw_file;
90 rtc::scoped_ptr<RawFile> output_raw_file; 90 rtc::scoped_ptr<RawFile> output_raw_file;
91 91
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 276
277 fprintf(settings_file, "\n"); 277 fprintf(settings_file, "\n");
278 278
279 if (reverse_sample_rate == 0) { 279 if (reverse_sample_rate == 0) {
280 reverse_sample_rate = input_sample_rate; 280 reverse_sample_rate = input_sample_rate;
281 } 281 }
282 if (output_sample_rate == 0) { 282 if (output_sample_rate == 0) {
283 output_sample_rate = input_sample_rate; 283 output_sample_rate = input_sample_rate;
284 } 284 }
285 285
286 reverse_samples_per_channel = reverse_sample_rate / 100; 286 reverse_samples_per_channel =
287 input_samples_per_channel = input_sample_rate / 100; 287 static_cast<size_t>(reverse_sample_rate / 100);
288 output_samples_per_channel = output_sample_rate / 100; 288 input_samples_per_channel =
289 static_cast<size_t>(input_sample_rate / 100);
290 output_samples_per_channel =
291 static_cast<size_t>(output_sample_rate / 100);
289 292
290 if (!FLAGS_raw) { 293 if (!FLAGS_raw) {
291 // The WAV files need to be reset every time, because they cant change 294 // The WAV files need to be reset every time, because they cant change
292 // their sample rate or number of channels. 295 // their sample rate or number of channels.
293 reverse_wav_file.reset(new WavWriter(FLAGS_reverse_file + ".wav", 296 reverse_wav_file.reset(new WavWriter(FLAGS_reverse_file + ".wav",
294 reverse_sample_rate, 297 reverse_sample_rate,
295 num_reverse_channels)); 298 num_reverse_channels));
296 input_wav_file.reset(new WavWriter(FLAGS_input_file + ".wav", 299 input_wav_file.reset(new WavWriter(FLAGS_input_file + ".wav",
297 input_sample_rate, 300 input_sample_rate,
298 num_input_channels)); 301 num_input_channels));
299 output_wav_file.reset(new WavWriter(FLAGS_output_file + ".wav", 302 output_wav_file.reset(new WavWriter(FLAGS_output_file + ".wav",
300 output_sample_rate, 303 output_sample_rate,
301 num_output_channels)); 304 num_output_channels));
302 } 305 }
303 } 306 }
304 } 307 }
305 308
306 return 0; 309 return 0;
307 } 310 }
308 311
309 } // namespace webrtc 312 } // namespace webrtc
310 313
311 int main(int argc, char* argv[]) { 314 int main(int argc, char* argv[]) {
312 return webrtc::do_main(argc, argv); 315 return webrtc::do_main(argc, argv);
313 } 316 }
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/test/test_utils.cc ('k') | webrtc/modules/media_file/media_file_utility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698