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

Unified Diff: content/renderer/media/webrtc_local_audio_renderer.cc

Issue 12769010: Avoids deadlock in WebRtcLocalAudioRenderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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: content/renderer/media/webrtc_local_audio_renderer.cc
diff --git a/content/renderer/media/webrtc_local_audio_renderer.cc b/content/renderer/media/webrtc_local_audio_renderer.cc
index 2606a0de276415a43617f4a35dbeb2aa492dd230..cc5ba771048fe41e710ce2ef80f8376f11022aae 100644
--- a/content/renderer/media/webrtc_local_audio_renderer.cc
+++ b/content/renderer/media/webrtc_local_audio_renderer.cc
@@ -177,20 +177,24 @@ void WebRtcLocalAudioRenderer::Start() {
void WebRtcLocalAudioRenderer::Stop() {
DVLOG(1) << "WebRtcLocalAudioRenderer::Stop()";
DCHECK(thread_checker_.CalledOnValidThread());
- base::AutoLock auto_lock(thread_lock_);
if (!sink_)
return;
+ {
+ base::AutoLock auto_lock(thread_lock_);
+ playing_ = false;
+
+ if (loopback_fifo_.get() != NULL) {
+ loopback_fifo_->Clear();
+ loopback_fifo_.reset();
+ }
+ }
+
// Stop the output audio stream, i.e, stop asking for data to render.
sink_->Stop();
sink_ = NULL;
- if (loopback_fifo_.get() != NULL) {
- loopback_fifo_->Clear();
- loopback_fifo_.reset();
- }
-
// Ensure that the capturer stops feeding us with captured audio.
// Note that, we do not stop the capturer here since it may still be used by
// the WebRTC ADM.
« 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