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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 } | 460 } |
461 | 461 |
462 void Pipeline::OnVideoTimeUpdate(base::TimeDelta max_time) { | 462 void Pipeline::OnVideoTimeUpdate(base::TimeDelta max_time) { |
463 DCHECK(IsRunning()); | 463 DCHECK(IsRunning()); |
464 base::AutoLock auto_lock(lock_); | 464 base::AutoLock auto_lock(lock_); |
465 | 465 |
466 if (has_audio_) | 466 if (has_audio_) |
467 return; | 467 return; |
468 | 468 |
469 DCHECK(!waiting_for_clock_update_); | 469 DCHECK(!waiting_for_clock_update_); |
470 DCHECK(clock_->Elapsed() <= max_time); | |
471 clock_->SetMaxTime(max_time); | 470 clock_->SetMaxTime(max_time); |
472 } | 471 } |
473 | 472 |
474 void Pipeline::SetDuration(base::TimeDelta duration) { | 473 void Pipeline::SetDuration(base::TimeDelta duration) { |
475 DCHECK(IsRunning()); | 474 DCHECK(IsRunning()); |
476 media_log_->AddEvent( | 475 media_log_->AddEvent( |
477 media_log_->CreateTimeEvent( | 476 media_log_->CreateTimeEvent( |
478 MediaLogEvent::DURATION_SET, "duration", duration)); | 477 MediaLogEvent::DURATION_SET, "duration", duration)); |
479 UMA_HISTOGRAM_LONG_TIMES("Media.Duration", duration); | 478 UMA_HISTOGRAM_LONG_TIMES("Media.Duration", duration); |
480 | 479 |
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { | 1417 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { |
1419 lock_.AssertAcquired(); | 1418 lock_.AssertAcquired(); |
1420 if (!waiting_for_clock_update_) | 1419 if (!waiting_for_clock_update_) |
1421 return; | 1420 return; |
1422 | 1421 |
1423 waiting_for_clock_update_ = false; | 1422 waiting_for_clock_update_ = false; |
1424 clock_->Play(); | 1423 clock_->Play(); |
1425 } | 1424 } |
1426 | 1425 |
1427 } // namespace media | 1426 } // namespace media |
OLD | NEW |