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

Unified Diff: media/filters/audio_renderer_impl.cc

Issue 240123004: Simplify AudioSplicer logic which slots buffers before or after a splice point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 6 years, 8 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
« no previous file with comments | « media/base/stream_parser_buffer.h ('k') | media/filters/audio_renderer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_impl.cc
diff --git a/media/filters/audio_renderer_impl.cc b/media/filters/audio_renderer_impl.cc
index bb279e9156e1ddbd6ffeb753f816582442e6ec73..dd885279af897c0b7520e11aad082bd444ab7b9a 100644
--- a/media/filters/audio_renderer_impl.cc
+++ b/media/filters/audio_renderer_impl.cc
@@ -757,6 +757,11 @@ void AudioRendererImpl::OnConfigChange() {
DCHECK(task_runner_->BelongsToCurrentThread());
DCHECK(expecting_config_changes_);
buffer_converter_->ResetTimestampState();
+ // Drain flushed buffers from the converter so the AudioSplicer receives all
+ // data ahead of any OnNewSpliceBuffer() calls. Since discontinuities should
+ // only appear after config changes, AddInput() should never fail here.
+ while (buffer_converter_->HasNextBuffer())
+ CHECK(splicer_->AddInput(buffer_converter_->GetNextBuffer()));
}
} // namespace media
« no previous file with comments | « media/base/stream_parser_buffer.h ('k') | media/filters/audio_renderer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698