OLD | NEW |
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 Loading... |
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 |
OLD | NEW |