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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 DoFlush_Locked(); | 292 DoFlush_Locked(); |
293 } | 293 } |
294 | 294 |
295 void AudioRendererImpl::DoFlush_Locked() { | 295 void AudioRendererImpl::DoFlush_Locked() { |
296 DCHECK(task_runner_->BelongsToCurrentThread()); | 296 DCHECK(task_runner_->BelongsToCurrentThread()); |
297 lock_.AssertAcquired(); | 297 lock_.AssertAcquired(); |
298 | 298 |
299 DCHECK(!pending_read_); | 299 DCHECK(!pending_read_); |
300 DCHECK_EQ(state_, kFlushed); | 300 DCHECK_EQ(state_, kFlushed); |
301 | 301 |
| 302 ended_timestamp_ = kInfiniteDuration(); |
302 audio_buffer_stream_->Reset(base::Bind(&AudioRendererImpl::ResetDecoderDone, | 303 audio_buffer_stream_->Reset(base::Bind(&AudioRendererImpl::ResetDecoderDone, |
303 weak_factory_.GetWeakPtr())); | 304 weak_factory_.GetWeakPtr())); |
304 } | 305 } |
305 | 306 |
306 void AudioRendererImpl::ResetDecoderDone() { | 307 void AudioRendererImpl::ResetDecoderDone() { |
307 DCHECK(task_runner_->BelongsToCurrentThread()); | 308 DCHECK(task_runner_->BelongsToCurrentThread()); |
308 { | 309 { |
309 base::AutoLock auto_lock(lock_); | 310 base::AutoLock auto_lock(lock_); |
310 | 311 |
311 DCHECK_EQ(state_, kFlushed); | 312 DCHECK_EQ(state_, kFlushed); |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 DCHECK_NE(buffering_state_, buffering_state); | 968 DCHECK_NE(buffering_state_, buffering_state); |
968 lock_.AssertAcquired(); | 969 lock_.AssertAcquired(); |
969 buffering_state_ = buffering_state; | 970 buffering_state_ = buffering_state; |
970 | 971 |
971 task_runner_->PostTask( | 972 task_runner_->PostTask( |
972 FROM_HERE, base::Bind(&AudioRendererImpl::OnBufferingStateChange, | 973 FROM_HERE, base::Bind(&AudioRendererImpl::OnBufferingStateChange, |
973 weak_factory_.GetWeakPtr(), buffering_state_)); | 974 weak_factory_.GetWeakPtr(), buffering_state_)); |
974 } | 975 } |
975 | 976 |
976 } // namespace media | 977 } // namespace media |
OLD | NEW |