Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: media/filters/renderer_impl.cc

Issue 518613002: Have AudioRendererImpl advance time until it's told to stop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/filters/renderer_impl.h" 5 #include "media/filters/renderer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 void RendererImpl::OnAudioRendererEnded() { 496 void RendererImpl::OnAudioRendererEnded() {
497 DVLOG(2) << __FUNCTION__; 497 DVLOG(2) << __FUNCTION__;
498 DCHECK(task_runner_->BelongsToCurrentThread()); 498 DCHECK(task_runner_->BelongsToCurrentThread());
499 499
500 if (state_ != STATE_PLAYING) 500 if (state_ != STATE_PLAYING)
501 return; 501 return;
502 502
503 DCHECK(!audio_ended_); 503 DCHECK(!audio_ended_);
504 audio_ended_ = true; 504 audio_ended_ = true;
505 505
506 // Start clock since there is no more audio to trigger clock updates.
507 {
508 base::TimeDelta duration = get_duration_cb_.Run();
509 base::AutoLock auto_lock(interpolator_lock_);
510 interpolator_->SetUpperBound(duration);
511 StartClockIfWaitingForTimeUpdate_Locked();
512 }
513
514 RunEndedCallbackIfNeeded(); 506 RunEndedCallbackIfNeeded();
515 } 507 }
516 508
517 void RendererImpl::OnVideoRendererEnded() { 509 void RendererImpl::OnVideoRendererEnded() {
518 DVLOG(2) << __FUNCTION__; 510 DVLOG(2) << __FUNCTION__;
519 DCHECK(task_runner_->BelongsToCurrentThread()); 511 DCHECK(task_runner_->BelongsToCurrentThread());
520 512
521 if (state_ != STATE_PLAYING) 513 if (state_ != STATE_PLAYING)
522 return; 514 return;
523 515
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 DCHECK(task_runner_->BelongsToCurrentThread()); 556 DCHECK(task_runner_->BelongsToCurrentThread());
565 557
566 if (!init_cb_.is_null()) 558 if (!init_cb_.is_null())
567 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_ABORT); 559 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_ABORT);
568 560
569 if (!flush_cb_.is_null()) 561 if (!flush_cb_.is_null())
570 base::ResetAndReturn(&flush_cb_).Run(); 562 base::ResetAndReturn(&flush_cb_).Run();
571 } 563 }
572 564
573 } // namespace media 565 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698