Fix incomplete teardown of demuxer.

I ran into an issue with PipelineIntegrationTests where one of the
security videos was causing ~FileDataSource to DCHECK complain about
file_ never being torn down.

Tracing this back, it's because we return NULL for the demuxer when
an error is encountered. This prevents demuxer->Stop() from being called
which leaves the data source in an unhappy state.

BUG=none
TEST=PipelineIntegrationTests/media_unittests


Review URL: http://codereview.chromium.org/9350004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120730 0039d316-1c4b-4281-b951-d872f2087c98
parent c26ad883
......@@ -1139,17 +1139,13 @@ void Pipeline::OnDemuxerBuilt(PipelineStatus status, Demuxer* demuxer) {
return;
}
demuxer_ = demuxer;
if (status != PIPELINE_OK) {
SetError(status);
return;
}
if (!demuxer) {
SetError(PIPELINE_ERROR_REQUIRED_FILTER_MISSING);
return;
}
demuxer_ = demuxer;
CHECK(demuxer_) << "Null demuxer encountered despite PIPELINE_OK.";
demuxer_->set_host(this);
{
......
......@@ -22,11 +22,7 @@ FFmpegDemuxerFactory::~FFmpegDemuxerFactory() {}
static void DemuxerInitDone(const DemuxerFactory::BuildCallback& cb,
const scoped_refptr<FFmpegDemuxer>& demuxer,
PipelineStatus status) {
if (status != PIPELINE_OK) {
cb.Run(status, NULL);
return;
}
cb.Run(PIPELINE_OK, demuxer);
cb.Run(status, demuxer);
}
void FFmpegDemuxerFactory::Build(const std::string& url,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment