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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 DoFlush_Locked(); | 284 DoFlush_Locked(); |
285 } | 285 } |
286 | 286 |
287 void AudioRendererImpl::DoFlush_Locked() { | 287 void AudioRendererImpl::DoFlush_Locked() { |
288 DCHECK(task_runner_->BelongsToCurrentThread()); | 288 DCHECK(task_runner_->BelongsToCurrentThread()); |
289 lock_.AssertAcquired(); | 289 lock_.AssertAcquired(); |
290 | 290 |
291 DCHECK(!pending_read_); | 291 DCHECK(!pending_read_); |
292 DCHECK_EQ(state_, kFlushed); | 292 DCHECK_EQ(state_, kFlushed); |
293 | 293 |
294 ended_timestamp_ = kInfiniteDuration(); | |
chcunningham
2016/06/24 23:32:55
This seems like the right thing - just curious how
servolk
2016/06/25 00:36:33
I've been testing this CL manually, trying a bunch
| |
294 audio_buffer_stream_->Reset(base::Bind(&AudioRendererImpl::ResetDecoderDone, | 295 audio_buffer_stream_->Reset(base::Bind(&AudioRendererImpl::ResetDecoderDone, |
295 weak_factory_.GetWeakPtr())); | 296 weak_factory_.GetWeakPtr())); |
296 } | 297 } |
297 | 298 |
298 void AudioRendererImpl::ResetDecoderDone() { | 299 void AudioRendererImpl::ResetDecoderDone() { |
299 DCHECK(task_runner_->BelongsToCurrentThread()); | 300 DCHECK(task_runner_->BelongsToCurrentThread()); |
300 { | 301 { |
301 base::AutoLock auto_lock(lock_); | 302 base::AutoLock auto_lock(lock_); |
302 | 303 |
303 DCHECK_EQ(state_, kFlushed); | 304 DCHECK_EQ(state_, kFlushed); |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
959 DCHECK_NE(buffering_state_, buffering_state); | 960 DCHECK_NE(buffering_state_, buffering_state); |
960 lock_.AssertAcquired(); | 961 lock_.AssertAcquired(); |
961 buffering_state_ = buffering_state; | 962 buffering_state_ = buffering_state; |
962 | 963 |
963 task_runner_->PostTask( | 964 task_runner_->PostTask( |
964 FROM_HERE, base::Bind(&AudioRendererImpl::OnBufferingStateChange, | 965 FROM_HERE, base::Bind(&AudioRendererImpl::OnBufferingStateChange, |
965 weak_factory_.GetWeakPtr(), buffering_state_)); | 966 weak_factory_.GetWeakPtr(), buffering_state_)); |
966 } | 967 } |
967 | 968 |
968 } // namespace media | 969 } // namespace media |
OLD | NEW |