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/renderers/audio_renderer_impl.h" | 5 #include "media/renderers/audio_renderer_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 DoFlush_Locked(); | 260 DoFlush_Locked(); |
261 } | 261 } |
262 | 262 |
263 void AudioRendererImpl::DoFlush_Locked() { | 263 void AudioRendererImpl::DoFlush_Locked() { |
264 DCHECK(task_runner_->BelongsToCurrentThread()); | 264 DCHECK(task_runner_->BelongsToCurrentThread()); |
265 lock_.AssertAcquired(); | 265 lock_.AssertAcquired(); |
266 | 266 |
267 DCHECK(!pending_read_); | 267 DCHECK(!pending_read_); |
268 DCHECK_EQ(state_, kFlushed); | 268 DCHECK_EQ(state_, kFlushed); |
269 | 269 |
| 270 ended_timestamp_ = kInfiniteDuration(); |
270 audio_buffer_stream_->Reset(base::Bind(&AudioRendererImpl::ResetDecoderDone, | 271 audio_buffer_stream_->Reset(base::Bind(&AudioRendererImpl::ResetDecoderDone, |
271 weak_factory_.GetWeakPtr())); | 272 weak_factory_.GetWeakPtr())); |
272 } | 273 } |
273 | 274 |
274 void AudioRendererImpl::ResetDecoderDone() { | 275 void AudioRendererImpl::ResetDecoderDone() { |
275 DCHECK(task_runner_->BelongsToCurrentThread()); | 276 DCHECK(task_runner_->BelongsToCurrentThread()); |
276 { | 277 { |
277 base::AutoLock auto_lock(lock_); | 278 base::AutoLock auto_lock(lock_); |
278 | 279 |
279 DCHECK_EQ(state_, kFlushed); | 280 DCHECK_EQ(state_, kFlushed); |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 DCHECK_NE(buffering_state_, buffering_state); | 926 DCHECK_NE(buffering_state_, buffering_state); |
926 lock_.AssertAcquired(); | 927 lock_.AssertAcquired(); |
927 buffering_state_ = buffering_state; | 928 buffering_state_ = buffering_state; |
928 | 929 |
929 task_runner_->PostTask( | 930 task_runner_->PostTask( |
930 FROM_HERE, base::Bind(&AudioRendererImpl::OnBufferingStateChange, | 931 FROM_HERE, base::Bind(&AudioRendererImpl::OnBufferingStateChange, |
931 weak_factory_.GetWeakPtr(), buffering_state_)); | 932 weak_factory_.GetWeakPtr(), buffering_state_)); |
932 } | 933 } |
933 | 934 |
934 } // namespace media | 935 } // namespace media |
OLD | NEW |