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

Side by Side Diff: media/base/pipeline.cc

Issue 9350004: Fix incomplete teardown of demuxer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CHECK. Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | media/filters/ffmpeg_demuxer_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 url_, base::Bind(&Pipeline::OnDemuxerBuilt, this)); 1130 url_, base::Bind(&Pipeline::OnDemuxerBuilt, this));
1131 } 1131 }
1132 1132
1133 void Pipeline::OnDemuxerBuilt(PipelineStatus status, Demuxer* demuxer) { 1133 void Pipeline::OnDemuxerBuilt(PipelineStatus status, Demuxer* demuxer) {
1134 if (MessageLoop::current() != message_loop_) { 1134 if (MessageLoop::current() != message_loop_) {
1135 message_loop_->PostTask(FROM_HERE, base::Bind( 1135 message_loop_->PostTask(FROM_HERE, base::Bind(
1136 &Pipeline::OnDemuxerBuilt, this, status, make_scoped_refptr(demuxer))); 1136 &Pipeline::OnDemuxerBuilt, this, status, make_scoped_refptr(demuxer)));
1137 return; 1137 return;
1138 } 1138 }
1139 1139
1140 demuxer_ = demuxer;
1140 if (status != PIPELINE_OK) { 1141 if (status != PIPELINE_OK) {
1141 SetError(status); 1142 SetError(status);
1142 return; 1143 return;
1143 } 1144 }
1144 1145
1145 if (!demuxer) { 1146 CHECK(demuxer_) << "Null demuxer encountered despite PIPELINE_OK.";
1146 SetError(PIPELINE_ERROR_REQUIRED_FILTER_MISSING);
1147 return;
1148 }
1149
1150 demuxer_ = demuxer;
1151 demuxer_->set_host(this); 1147 demuxer_->set_host(this);
1152 1148
1153 { 1149 {
1154 base::AutoLock auto_lock(lock_); 1150 base::AutoLock auto_lock(lock_);
1155 // We do not want to start the clock running. We only want to set the base 1151 // We do not want to start the clock running. We only want to set the base
1156 // media time so our timestamp calculations will be correct. 1152 // media time so our timestamp calculations will be correct.
1157 clock_->SetTime(demuxer_->GetStartTime(), demuxer_->GetStartTime()); 1153 clock_->SetTime(demuxer_->GetStartTime(), demuxer_->GetStartTime());
1158 } 1154 }
1159 1155
1160 OnFilterInitialize(PIPELINE_OK); 1156 OnFilterInitialize(PIPELINE_OK);
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1425 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { 1421 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() {
1426 lock_.AssertAcquired(); 1422 lock_.AssertAcquired();
1427 if (!waiting_for_clock_update_) 1423 if (!waiting_for_clock_update_)
1428 return; 1424 return;
1429 1425
1430 waiting_for_clock_update_ = false; 1426 waiting_for_clock_update_ = false;
1431 clock_->Play(); 1427 clock_->Play();
1432 } 1428 }
1433 1429
1434 } // namespace media 1430 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/filters/ffmpeg_demuxer_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698