Chromium Code Reviews| Index: media/filters/chunk_demuxer.cc |
| diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc |
| index 44dd3923aab846d1e21228251368badf47306486..2b41cb67d4d708ce1fa50b69d63e65d215a1509b 100644 |
| --- a/media/filters/chunk_demuxer.cc |
| +++ b/media/filters/chunk_demuxer.cc |
| @@ -335,8 +335,7 @@ ChunkDemuxer::ChunkDemuxer(ChunkDemuxerClient* client) |
| : state_(WAITING_FOR_INIT), |
| client_(client), |
| buffered_bytes_(0), |
| - seek_waits_for_data_(true), |
| - deferred_error_(PIPELINE_OK) { |
| + seek_waits_for_data_(true) { |
| DCHECK(client); |
| } |
| @@ -344,7 +343,7 @@ ChunkDemuxer::~ChunkDemuxer() { |
| DCHECK_NE(state_, INITIALIZED); |
| } |
| -void ChunkDemuxer::Init(const PipelineStatusCB& cb) { |
| +void ChunkDemuxer::Initialize(const PipelineStatusCB& cb) { |
| DVLOG(1) << "Init()"; |
| { |
| base::AutoLock auto_lock(lock_); |
| @@ -363,14 +362,10 @@ void ChunkDemuxer::Init(const PipelineStatusCB& cb) { |
| } |
| void ChunkDemuxer::set_host(DemuxerHost* host) { |
| - DCHECK(state_ == INITIALIZED || state_ == PARSE_ERROR); |
| + // XXXXXXX can we tighten up the set_host() requirements to be done before |
| + // Initialize() is called? |
|
scherkus (not reviewing)
2012/03/27 16:51:11
NOTE: I did precisely that. It's crazy that you sh
acolwell GONE FROM CHROMIUM
2012/03/27 20:11:35
I'm fine with you removing this method.
On 2012/0
scherkus (not reviewing)
2012/03/27 20:44:09
Done.
|
| + DCHECK_EQ(state_, WAITING_FOR_INIT); |
| Demuxer::set_host(host); |
| - host->SetDuration(duration_); |
| - host->SetCurrentReadPosition(0); |
| - if (deferred_error_ != PIPELINE_OK) { |
| - host->OnDemuxerError(deferred_error_); |
| - deferred_error_ = PIPELINE_OK; |
| - } |
| } |
| void ChunkDemuxer::Stop(const base::Closure& callback) { |
| @@ -662,14 +657,8 @@ void ChunkDemuxer::ReportError_Locked(PipelineStatus error) { |
| return; |
| } |
| - DemuxerHost* demuxer_host = host(); |
| - if (demuxer_host) { |
| - base::AutoUnlock auto_unlock(lock_); |
| - demuxer_host->OnDemuxerError(error); |
| - return; |
| - } |
| - |
| - deferred_error_ = error; |
| + base::AutoUnlock auto_unlock(lock_); |
| + host()->OnDemuxerError(error); |
| } |
| void ChunkDemuxer::OnStreamParserInitDone(bool success, |
| @@ -682,6 +671,8 @@ void ChunkDemuxer::OnStreamParserInitDone(bool success, |
| } |
| duration_ = duration; |
| + host()->SetDuration(duration_); |
| + host()->SetCurrentReadPosition(0); |
| ChangeState_Locked(INITIALIZED); |
| PipelineStatusCB cb; |