| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |