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

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: Fix ClocklessAudioSink 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
« no previous file with comments | « media/base/mock_filters.h ('k') | media/base/pipeline_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline.cc
diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc
index efe91f676ff996946dfe2faac3f5015e08786dd3..f238d666b721029ed1ac53c46128664c27c7d194 100644
--- a/media/base/pipeline.cc
+++ b/media/base/pipeline.cc
@@ -494,6 +494,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_) {
@@ -501,11 +504,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())));
@@ -522,6 +520,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;
@@ -530,7 +529,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;
« no previous file with comments | « media/base/mock_filters.h ('k') | media/base/pipeline_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698