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

Unified Diff: media/base/multi_channel_resampler.cc

Issue 1211203006: Fixes issue where Web Speech API drops a frame every 5.1 seconds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« media/base/audio_converter.cc ('K') | « media/base/multi_channel_resampler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/multi_channel_resampler.cc
diff --git a/media/base/multi_channel_resampler.cc b/media/base/multi_channel_resampler.cc
index b0ab88d6820cb7a1ca1c5fc42c5f51d6a52e244c..6de6eafeb8dfb98f182e4c172fbc0060cfb47ea0 100644
--- a/media/base/multi_channel_resampler.cc
+++ b/media/base/multi_channel_resampler.cc
@@ -42,6 +42,13 @@ MultiChannelResampler::MultiChannelResampler(int channels,
MultiChannelResampler::~MultiChannelResampler() {}
+void MultiChannelResampler::PrimeWithSilence() {
+ DCHECK(!resamplers_.empty());
+ for (size_t i = 0; i < resamplers_.size(); ++i) {
DaleCurtis 2015/07/07 16:38:17 No {} for single line please.
henrika (OOO until Aug 14) 2015/07/08 12:22:59 Done.
+ resamplers_[i]->PrimeWithSilence();
+ }
+}
+
void MultiChannelResampler::Resample(int frames, AudioBus* audio_bus) {
DCHECK_EQ(static_cast<size_t>(audio_bus->channels()), resamplers_.size());
« media/base/audio_converter.cc ('K') | « media/base/multi_channel_resampler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698