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

Unified Diff: media/renderers/audio_renderer_impl.cc

Issue 2780693004: Add checks to track down AudioClock crash. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/audio_renderer_impl.cc
diff --git a/media/renderers/audio_renderer_impl.cc b/media/renderers/audio_renderer_impl.cc
index 7cb22ffb1695abb831acbfac99a6b19983c33dae..596603b96f99dbda5c65adf925e85025ee78dd79 100644
--- a/media/renderers/audio_renderer_impl.cc
+++ b/media/renderers/audio_renderer_impl.cc
@@ -94,6 +94,12 @@ AudioRendererImpl::~AudioRendererImpl() {
// After this call, the |sink_| will not call back into |this| anymore.
sink_->Stop();
+ // Trying to track down AudioClock crash, http://crbug.com/674856. If the sink
+ // hasn't truly stopped above we will fail to acquire the lock. The sink must
+ // be stopped to avoid destroying the AudioClock while its still being used.
+ CHECK(lock_.Try());
+ lock_.Release();
+
if (!init_cb_.is_null())
base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_ABORT);
}
@@ -337,6 +343,11 @@ void AudioRendererImpl::Initialize(DemuxerStream* stream,
DCHECK_EQ(kUninitialized, state_);
DCHECK(sink_.get());
+ // Trying to track down AudioClock crash, http://crbug.com/674856.
+ // AudioRenderImpl should only be initialized once to avoid destroying
+ // AudioClock while the audio thread is still using it.
+ CHECK_EQ(audio_clock_.get(), nullptr);
+
state_ = kInitializing;
client_ = client;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698