Reformat the WebRTC code base
Running clang-format with chromium's style guide. The goal is n-fold: * providing consistency and readability (that's what code guidelines are for) * preventing noise with presubmit checks and git cl format * building on the previous point: making it easier to automatically fix format issues * you name it Please consider using git-hyper-blame to ignore this commit. Bug: webrtc:9340 Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87 Reviewed-on: https://webrtc-review.googlesource.com/81185 Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23660}
This commit is contained in:
@ -21,16 +21,18 @@ bool AudioLoop::Init(const std::string file_name,
|
||||
size_t max_loop_length_samples,
|
||||
size_t block_length_samples) {
|
||||
FILE* fp = fopen(file_name.c_str(), "rb");
|
||||
if (!fp) return false;
|
||||
if (!fp)
|
||||
return false;
|
||||
|
||||
audio_array_.reset(new int16_t[max_loop_length_samples +
|
||||
block_length_samples]);
|
||||
size_t samples_read = fread(audio_array_.get(), sizeof(int16_t),
|
||||
max_loop_length_samples, fp);
|
||||
audio_array_.reset(
|
||||
new int16_t[max_loop_length_samples + block_length_samples]);
|
||||
size_t samples_read =
|
||||
fread(audio_array_.get(), sizeof(int16_t), max_loop_length_samples, fp);
|
||||
fclose(fp);
|
||||
|
||||
// Block length must be shorter than the loop length.
|
||||
if (block_length_samples > samples_read) return false;
|
||||
if (block_length_samples > samples_read)
|
||||
return false;
|
||||
|
||||
// Add an extra block length of samples to the end of the array, starting
|
||||
// over again from the beginning of the array. This is done to simplify
|
||||
@ -54,6 +56,5 @@ rtc::ArrayView<const int16_t> AudioLoop::GetNextBlock() {
|
||||
return rtc::ArrayView<const int16_t>(output_ptr, block_length_samples_);
|
||||
}
|
||||
|
||||
|
||||
} // namespace test
|
||||
} // namespace webrtc
|
||||
|
Reference in New Issue
Block a user