Index: media/base/pipeline.cc |
diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc |
index 85ec3e8f5e9070e3e935e3c1f9985a8b0bb6fdb1..fc325eb39f828d0fb4452975039c7c5d8599a1a6 100644 |
--- a/media/base/pipeline.cc |
+++ b/media/base/pipeline.cc |
@@ -17,6 +17,7 @@ |
#include "base/synchronization/condition_variable.h" |
#include "media/base/audio_decoder.h" |
#include "media/base/audio_renderer.h" |
+#include "media/base/buffers.h" |
scherkus (not reviewing)
2012/08/08 01:05:30
for kNoTimestamp() which surprisingly enough isn't
|
#include "media/base/clock.h" |
#include "media/base/filter_collection.h" |
#include "media/base/media_log.h" |
@@ -68,12 +69,28 @@ struct Pipeline::PipelineInitState { |
Pipeline::Pipeline(MessageLoop* message_loop, MediaLog* media_log) |
: message_loop_(message_loop->message_loop_proxy()), |
media_log_(media_log), |
+ running_(false), |
+ seek_pending_(false), |
acolwell GONE FROM CHROMIUM
2012/08/08 17:17:28
This is probably best left for a different CL, but
scherkus (not reviewing)
2012/08/08 17:26:59
Yeah I have parts of that done in my yet-to-be-ful
|
+ stop_pending_(false), |
+ tearing_down_(false), |
+ error_caused_teardown_(false), |
+ playback_rate_change_pending_(false), |
+ did_loading_progress_(false), |
+ total_bytes_(0), |
+ natural_size_(0, 0), |
+ volume_(1.0f), |
+ playback_rate_(0.0f), |
+ pending_playback_rate_(0.0f), |
clock_(new Clock(&base::Time::Now)), |
waiting_for_clock_update_(false), |
+ status_(PIPELINE_OK), |
+ has_audio_(false), |
+ has_video_(false), |
state_(kCreated), |
+ seek_timestamp_(kNoTimestamp()), |
+ audio_disabled_(false), |
creation_time_(base::Time::Now()) { |
media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(kCreated)); |
- ResetState(); |
media_log_->AddEvent( |
media_log_->CreateEvent(MediaLogEvent::PIPELINE_CREATED)); |
} |
@@ -242,30 +259,6 @@ void Pipeline::SetClockForTesting(Clock* clock) { |
clock_.reset(clock); |
} |
-void Pipeline::ResetState() { |
- base::AutoLock auto_lock(lock_); |
- const TimeDelta kZero; |
- running_ = false; |
- stop_pending_ = false; |
- seek_pending_ = false; |
- tearing_down_ = false; |
- error_caused_teardown_ = false; |
- playback_rate_change_pending_ = false; |
- buffered_byte_ranges_.clear(); |
- did_loading_progress_ = false; |
- total_bytes_ = 0; |
- natural_size_.SetSize(0, 0); |
- volume_ = 1.0f; |
- playback_rate_ = 0.0f; |
- pending_playback_rate_ = 0.0f; |
- status_ = PIPELINE_OK; |
- has_audio_ = false; |
- has_video_ = false; |
- waiting_for_clock_update_ = false; |
- audio_disabled_ = false; |
- clock_->Reset(); |
-} |
- |
void Pipeline::SetState(State next_state) { |
if (state_ != kStarted && next_state == kStarted && |
!creation_time_.is_null()) { |
@@ -1016,7 +1009,11 @@ void Pipeline::FinishDestroyingFiltersTask() { |
if (stop_pending_) { |
stop_pending_ = false; |
- ResetState(); |
+ { |
+ base::AutoLock l(lock_); |
+ running_ = false; |
+ } |
+ |
// Notify the client that stopping has finished. |
base::ResetAndReturn(&stop_cb_).Run(); |
} |