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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/audio_renderer_impl.h" 5 #include "media/filters/audio_renderer_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 750
751 void AudioRendererImpl::OnNewSpliceBuffer(base::TimeDelta splice_timestamp) { 751 void AudioRendererImpl::OnNewSpliceBuffer(base::TimeDelta splice_timestamp) {
752 DCHECK(task_runner_->BelongsToCurrentThread()); 752 DCHECK(task_runner_->BelongsToCurrentThread());
753 splicer_->SetSpliceTimestamp(splice_timestamp); 753 splicer_->SetSpliceTimestamp(splice_timestamp);
754 } 754 }
755 755
756 void AudioRendererImpl::OnConfigChange() { 756 void AudioRendererImpl::OnConfigChange() {
757 DCHECK(task_runner_->BelongsToCurrentThread()); 757 DCHECK(task_runner_->BelongsToCurrentThread());
758 DCHECK(expecting_config_changes_); 758 DCHECK(expecting_config_changes_);
759 buffer_converter_->ResetTimestampState(); 759 buffer_converter_->ResetTimestampState();
760 // Drain flushed buffers from the converter so the AudioSplicer receives all
761 // data ahead of any OnNewSpliceBuffer() calls. Since discontinuities should
762 // only appear after config changes, AddInput() should never fail here.
763 while (buffer_converter_->HasNextBuffer())
764 CHECK(splicer_->AddInput(buffer_converter_->GetNextBuffer()));
760 } 765 }
761 766
762 } // namespace media 767 } // namespace media
OLDNEW
« 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