diff --git a/modules/audio_processing/aec3/aec3_fft.cc b/modules/audio_processing/aec3/aec3_fft.cc index 5c9a061cba..b02f3425b7 100644 --- a/modules/audio_processing/aec3/aec3_fft.cc +++ b/modules/audio_processing/aec3/aec3_fft.cc @@ -98,7 +98,7 @@ void Aec3Fft::ZeroPaddedFft(rtc::ArrayView x, } void Aec3Fft::PaddedFft(rtc::ArrayView x, - rtc::ArrayView x_old, + rtc::ArrayView x_old, Window window, FftData* X) const { RTC_DCHECK(X); @@ -110,7 +110,6 @@ void Aec3Fft::PaddedFft(rtc::ArrayView x, case Window::kRectangular: std::copy(x_old.begin(), x_old.end(), fft.begin()); std::copy(x.begin(), x.end(), fft.begin() + x_old.size()); - std::copy(x.begin(), x.end(), x_old.begin()); break; case Window::kHanning: RTC_NOTREACHED(); diff --git a/modules/audio_processing/aec3/aec3_fft.h b/modules/audio_processing/aec3/aec3_fft.h index f730284745..b70022255d 100644 --- a/modules/audio_processing/aec3/aec3_fft.h +++ b/modules/audio_processing/aec3/aec3_fft.h @@ -51,14 +51,14 @@ class Aec3Fft { // Concatenates the kFftLengthBy2 values long x and x_old before computing the // Fft. After that, x is copied to x_old. void PaddedFft(rtc::ArrayView x, - rtc::ArrayView x_old, + rtc::ArrayView x_old, FftData* X) const { PaddedFft(x, x_old, Window::kRectangular, X); } // Padded Fft using a time-domain window. void PaddedFft(rtc::ArrayView x, - rtc::ArrayView x_old, + rtc::ArrayView x_old, Window window, FftData* X) const; diff --git a/modules/audio_processing/aec3/aec3_fft_unittest.cc b/modules/audio_processing/aec3/aec3_fft_unittest.cc index 87fe7a8fbb..82d6e766cc 100644 --- a/modules/audio_processing/aec3/aec3_fft_unittest.cc +++ b/modules/audio_processing/aec3/aec3_fft_unittest.cc @@ -199,6 +199,7 @@ TEST(Aec3Fft, PaddedFft) { std::for_each(x_ref.begin(), x_ref.end(), [](float& a) { a *= 64.f; }); fft.PaddedFft(x_in, x_old, &X); + std::copy(x_in.begin(), x_in.end(), x_old.begin()); fft.Ifft(X, &x_out); for (size_t j = 0; j < x_out.size(); ++j) {