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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 DCHECK(IsRunning()); | 438 DCHECK(IsRunning()); |
439 return GetCurrentTime(); | 439 return GetCurrentTime(); |
440 } | 440 } |
441 | 441 |
442 base::TimeDelta Pipeline::GetDuration() const { | 442 base::TimeDelta Pipeline::GetDuration() const { |
443 DCHECK(IsRunning()); | 443 DCHECK(IsRunning()); |
444 return GetMediaDuration(); | 444 return GetMediaDuration(); |
445 } | 445 } |
446 | 446 |
447 void Pipeline::OnAudioTimeUpdate(base::TimeDelta time, | 447 void Pipeline::OnAudioTimeUpdate(base::TimeDelta time, |
448 base::TimeDelta max_time) { | 448 base::TimeDelta max_time) { |
449 DCHECK(time <= max_time); | 449 DCHECK(time <= max_time); |
450 DCHECK(IsRunning()); | 450 DCHECK(IsRunning()); |
451 base::AutoLock auto_lock(lock_); | 451 base::AutoLock auto_lock(lock_); |
452 | 452 |
453 if (!has_audio_) | 453 if (!has_audio_) |
454 return; | 454 return; |
455 if (waiting_for_clock_update_ && time < clock_->Elapsed()) | 455 if (waiting_for_clock_update_ && time < clock_->Elapsed()) |
456 return; | 456 return; |
457 | 457 |
458 clock_->SetTime(time, max_time); | 458 clock_->SetTime(time, max_time); |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1417 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { | 1417 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { |
1418 lock_.AssertAcquired(); | 1418 lock_.AssertAcquired(); |
1419 if (!waiting_for_clock_update_) | 1419 if (!waiting_for_clock_update_) |
1420 return; | 1420 return; |
1421 | 1421 |
1422 waiting_for_clock_update_ = false; | 1422 waiting_for_clock_update_ = false; |
1423 clock_->Play(); | 1423 clock_->Play(); |
1424 } | 1424 } |
1425 | 1425 |
1426 } // namespace media | 1426 } // namespace media |
OLD | NEW |