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/base/pipeline.h" | 5 #include "media/base/pipeline.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 DCHECK(IsRunning()); | 429 DCHECK(IsRunning()); |
430 return GetCurrentTime(); | 430 return GetCurrentTime(); |
431 } | 431 } |
432 | 432 |
433 base::TimeDelta Pipeline::GetDuration() const { | 433 base::TimeDelta Pipeline::GetDuration() const { |
434 DCHECK(IsRunning()); | 434 DCHECK(IsRunning()); |
435 return GetMediaDuration(); | 435 return GetMediaDuration(); |
436 } | 436 } |
437 | 437 |
438 void Pipeline::OnAudioTimeUpdate(base::TimeDelta time, | 438 void Pipeline::OnAudioTimeUpdate(base::TimeDelta time, |
439 base::TimeDelta max_time) { | 439 base::TimeDelta max_time) { |
440 DCHECK(time <= max_time); | 440 DCHECK(time <= max_time); |
441 DCHECK(IsRunning()); | 441 DCHECK(IsRunning()); |
442 base::AutoLock auto_lock(lock_); | 442 base::AutoLock auto_lock(lock_); |
443 | 443 |
444 if (!has_audio_) | 444 if (!has_audio_) |
445 return; | 445 return; |
446 if (waiting_for_clock_update_ && time < clock_->Elapsed()) | 446 if (waiting_for_clock_update_ && time < clock_->Elapsed()) |
447 return; | 447 return; |
448 | 448 |
449 clock_->SetTime(time, max_time); | 449 clock_->SetTime(time, max_time); |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { | 1370 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { |
1371 lock_.AssertAcquired(); | 1371 lock_.AssertAcquired(); |
1372 if (!waiting_for_clock_update_) | 1372 if (!waiting_for_clock_update_) |
1373 return; | 1373 return; |
1374 | 1374 |
1375 waiting_for_clock_update_ = false; | 1375 waiting_for_clock_update_ = false; |
1376 clock_->Play(); | 1376 clock_->Play(); |
1377 } | 1377 } |
1378 | 1378 |
1379 } // namespace media | 1379 } // namespace media |
OLD | NEW |