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

Unified Diff: webrtc/modules/audio_coding/neteq/comfort_noise.cc

Issue 1948483002: Using ring buffer for AudioVector in NetEq. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: removing a unittest Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
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..90b02daf71242d262a21ceccbf6da5dffc6672c9 100644
--- a/webrtc/modules/audio_coding/neteq/comfort_noise.cc
+++ b/webrtc/modules/audio_coding/neteq/comfort_noise.cc
@@ -67,10 +67,10 @@ int ComfortNoise::Generate(size_t requested_length,
LOG(LS_ERROR) << "Unknwown payload type";
return kUnknownPayloadType;
}
- // The expression &(*output)[0][0] is a pointer to the first element in
- // 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 +78,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.
« no previous file with comments | « webrtc/modules/audio_coding/neteq/background_noise.cc ('k') | webrtc/modules/audio_coding/neteq/dsp_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698