Index: trunk/src/content/renderer/media/webrtc_audio_renderer.cc |
=================================================================== |
--- trunk/src/content/renderer/media/webrtc_audio_renderer.cc (revision 256663) |
+++ trunk/src/content/renderer/media/webrtc_audio_renderer.cc (working copy) |
@@ -422,13 +422,6 @@ |
void WebRtcAudioRenderer::Stop() { |
DVLOG(1) << "WebRtcAudioRenderer::Stop()"; |
DCHECK(thread_checker_.CalledOnValidThread()); |
- // Make sure to stop the sink while _not_ holding the lock since the Render() |
- // callback may currently be executing and try to grab the lock while we're |
- // stopping the thread on which it runs. |
- // Stop the sink before calling RemoveAudioRenderer() to make sure that no |
- // more callbacks will be made while the renderer is being removed. |
- sink_->Stop(); |
- |
{ |
base::AutoLock auto_lock(lock_); |
if (state_ == UNINITIALIZED) |
@@ -443,6 +436,11 @@ |
source_ = NULL; |
state_ = UNINITIALIZED; |
} |
+ |
+ // Make sure to stop the sink while _not_ holding the lock since the Render() |
+ // callback may currently be executing and try to grab the lock while we're |
+ // stopping the thread on which it runs. |
+ sink_->Stop(); |
} |
void WebRtcAudioRenderer::SetVolume(float volume) { |