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

Unified Diff: media/filters/audio_renderer_impl.cc

Issue 12262058: Revert r180578, r180591, and r180604 from 1410 branch. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1410/src/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/audio_renderer_impl.h ('k') | media/filters/audio_renderer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_impl.cc
===================================================================
--- media/filters/audio_renderer_impl.cc (revision 182591)
+++ media/filters/audio_renderer_impl.cc (working copy)
@@ -30,7 +30,6 @@
media::AudioRendererSink* sink,
const SetDecryptorReadyCB& set_decryptor_ready_cb)
: message_loop_(message_loop),
- weak_factory_(this),
sink_(sink),
set_decryptor_ready_cb_(set_decryptor_ready_cb),
now_cb_(base::Bind(&base::Time::Now)),
@@ -45,12 +44,6 @@
actual_frames_per_buffer_(0) {
}
-AudioRendererImpl::~AudioRendererImpl() {
- // Stop() should have been called and |algorithm_| should have been destroyed.
- DCHECK(state_ == kUninitialized || state_ == kStopped);
- DCHECK(!algorithm_.get());
-}
-
void AudioRendererImpl::Play(const base::Closure& callback) {
DCHECK(message_loop_->BelongsToCurrentThread());
@@ -109,7 +102,7 @@
if (decrypting_demuxer_stream_) {
decrypting_demuxer_stream_->Reset(base::Bind(
- &AudioRendererImpl::ResetDecoder, weak_this_, callback));
+ &AudioRendererImpl::ResetDecoder, this, callback));
return;
}
@@ -125,9 +118,6 @@
DCHECK(message_loop_->BelongsToCurrentThread());
DCHECK(!callback.is_null());
- // TODO(scherkus): Consider invalidating |weak_factory_| and replacing
- // task-running guards that check |state_| with DCHECK().
-
if (sink_) {
sink_->Stop();
sink_ = NULL;
@@ -201,7 +191,6 @@
DCHECK_EQ(kUninitialized, state_);
DCHECK(sink_);
- weak_this_ = weak_factory_.GetWeakPtr();
init_cb_ = init_cb;
statistics_cb_ = statistics_cb;
underflow_cb_ = underflow_cb;
@@ -222,7 +211,7 @@
decoder_selector_ptr->SelectAudioDecoder(
stream,
statistics_cb,
- base::Bind(&AudioRendererImpl::OnDecoderSelected, weak_this_,
+ base::Bind(&AudioRendererImpl::OnDecoderSelected, this,
base::Passed(&decoder_selector)));
}
@@ -295,7 +284,7 @@
state_ = kPaused;
- sink_->Initialize(audio_parameters_, weak_this_);
+ sink_->Initialize(audio_parameters_, this);
sink_->Start();
base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK);
@@ -324,6 +313,12 @@
sink_->SetVolume(volume);
}
+AudioRendererImpl::~AudioRendererImpl() {
+ // Stop() should have been called and |algorithm_| should have been destroyed.
+ DCHECK(state_ == kUninitialized || state_ == kStopped);
+ DCHECK(!algorithm_.get());
+}
+
void AudioRendererImpl::DecodedAudioReady(
AudioDecoder::Status status,
const scoped_refptr<DataBuffer>& buffer) {
@@ -427,7 +422,7 @@
return;
pending_read_ = true;
- decoder_->Read(base::Bind(&AudioRendererImpl::DecodedAudioReady, weak_this_));
+ decoder_->Read(base::Bind(&AudioRendererImpl::DecodedAudioReady, this));
}
bool AudioRendererImpl::CanRead_Locked() {
@@ -571,7 +566,7 @@
if (CanRead_Locked()) {
message_loop_->PostTask(FROM_HERE, base::Bind(
- &AudioRendererImpl::AttemptRead, weak_this_));
+ &AudioRendererImpl::AttemptRead, this));
}
// The |audio_time_buffered_| is the ending timestamp of the last frame
« no previous file with comments | « media/filters/audio_renderer_impl.h ('k') | media/filters/audio_renderer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698