OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 0, | 204 0, |
205 block_size_, | 205 block_size_, |
206 num_output_channels_, | 206 num_output_channels_, |
207 output_buffer_.channels(), | 207 output_buffer_.channels(), |
208 first_frame_in_block); | 208 first_frame_in_block); |
209 | 209 |
210 first_frame_in_block += shift_amount_; | 210 first_frame_in_block += shift_amount_; |
211 } | 211 } |
212 | 212 |
213 // Copy output buffer to output | 213 // Copy output buffer to output |
214 CopyFrames(output_buffer_.channels(), | 214 if (output != nullptr) { |
215 0, | 215 CopyFrames(output_buffer_.channels(), 0, chunk_size_, num_output_channels_, |
216 chunk_size_, | 216 output, 0); |
217 num_output_channels_, | 217 } |
218 output, | |
219 0); | |
220 | 218 |
221 // Copy output buffer [chunk_size_, chunk_size_ + initial_delay] | 219 // Copy output buffer [chunk_size_, chunk_size_ + initial_delay] |
222 // to output buffer [0, initial_delay], zero the rest. | 220 // to output buffer [0, initial_delay], zero the rest. |
223 MoveFrames(output_buffer_.channels(), | 221 MoveFrames(output_buffer_.channels(), |
224 chunk_size, | 222 chunk_size, |
225 initial_delay_, | 223 initial_delay_, |
226 num_output_channels_, | 224 num_output_channels_, |
227 output_buffer_.channels(), | 225 output_buffer_.channels(), |
228 0); | 226 0); |
229 ZeroOut(output_buffer_.channels(), | 227 ZeroOut(output_buffer_.channels(), |
230 initial_delay_, | 228 initial_delay_, |
231 chunk_size_, | 229 chunk_size_, |
232 num_output_channels_); | 230 num_output_channels_); |
233 | 231 |
234 // Calculate new starting frames. | 232 // Calculate new starting frames. |
235 frame_offset_ = first_frame_in_block - chunk_size_; | 233 frame_offset_ = first_frame_in_block - chunk_size_; |
236 } | 234 } |
237 | 235 |
238 } // namespace webrtc | 236 } // namespace webrtc |
OLD | NEW |