Chromium Code Reviews| Index: webrtc/modules/audio_coding/neteq/comfort_noise.cc |
| diff --git a/webrtc/modules/audio_coding/neteq/comfort_noise.cc b/webrtc/modules/audio_coding/neteq/comfort_noise.cc |
| index 2a512bd750f258491f3fac1a77f25ae356da59b1..c6b6517085ac0672b605b3b94ce73fd36d5afdf0 100644 |
| --- a/webrtc/modules/audio_coding/neteq/comfort_noise.cc |
| +++ b/webrtc/modules/audio_coding/neteq/comfort_noise.cc |
| @@ -69,8 +69,9 @@ int ComfortNoise::Generate(size_t requested_length, |
| } |
| // The expression &(*output)[0][0] is a pointer to the first element in |
|
hlundin-webrtc
2016/05/10 07:53:18
This comment needs updating.
minyue-webrtc
2016/05/10 12:48:07
thanks. I missed it.
|
| // the first channel. |
| + std::unique_ptr<int16_t[]> temp(new int16_t[number_of_samples]); |
| if (!cng_decoder->Generate( |
| - rtc::ArrayView<int16_t>(&(*output)[0][0], number_of_samples), |
| + rtc::ArrayView<int16_t>(temp.get(), number_of_samples), |
| new_period)) { |
| // Error returned. |
| output->Zeros(requested_length); |
| @@ -78,6 +79,7 @@ int ComfortNoise::Generate(size_t requested_length, |
| "ComfortNoiseDecoder::Genererate failed to generate comfort noise"; |
| return kInternalError; |
| } |
| + (*output)[0].OverwriteAt(temp.get(), number_of_samples, 0); |
| if (first_call_) { |
| // Set tapering window parameters. Values are in Q15. |