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

Unified Diff: media/base/pipeline.cc

Issue 407583002: Fold AudioRenderer::Stop() into the dtor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: media/base/pipeline.cc
diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc
index ca53be0ceb874e7e567c0c6c831d425bd76b1329..1021ffe32222812d1c2a6ebef92cdda2901b8e5a 100644
--- a/media/base/pipeline.cc
+++ b/media/base/pipeline.cc
@@ -487,6 +487,9 @@ void Pipeline::DoSeek(
void Pipeline::DoStop(const PipelineStatusCB& done_cb) {
DCHECK(task_runner_->BelongsToCurrentThread());
DCHECK(!pending_callbacks_.get());
+
+ audio_renderer_.reset();
+
SerialRunner::Queue bound_fns;
if (demuxer_) {
@@ -494,11 +497,6 @@ void Pipeline::DoStop(const PipelineStatusCB& done_cb) {
&Demuxer::Stop, base::Unretained(demuxer_)));
}
- if (audio_renderer_) {
- bound_fns.Push(base::Bind(
- &AudioRenderer::Stop, base::Unretained(audio_renderer_.get())));
- }
-
if (video_renderer_) {
bound_fns.Push(base::Bind(
&VideoRenderer::Stop, base::Unretained(video_renderer_.get())));
@@ -515,6 +513,7 @@ void Pipeline::DoStop(const PipelineStatusCB& done_cb) {
void Pipeline::OnStopCompleted(PipelineStatus status) {
DCHECK(task_runner_->BelongsToCurrentThread());
DCHECK_EQ(state_, kStopping);
+ DCHECK(!audio_renderer_);
{
base::AutoLock l(lock_);
running_ = false;
@@ -523,7 +522,6 @@ void Pipeline::OnStopCompleted(PipelineStatus status) {
SetState(kStopped);
pending_callbacks_.reset();
filter_collection_.reset();
- audio_renderer_.reset();
video_renderer_.reset();
text_renderer_.reset();
demuxer_ = NULL;

Powered by Google App Engine
This is Rietveld 408576698