Chromium Code Reviews| Index: content/renderer/media/webrtc_audio_renderer.cc |
| diff --git a/content/renderer/media/webrtc_audio_renderer.cc b/content/renderer/media/webrtc_audio_renderer.cc |
| index edc014a1cbb09d72a2ba1bef7d1fd662ad4dc499..581faaa0a2df99dff77a3e7c2e0b1b55345da983 100644 |
| --- a/content/renderer/media/webrtc_audio_renderer.cc |
| +++ b/content/renderer/media/webrtc_audio_renderer.cc |
| @@ -422,6 +422,13 @@ void WebRtcAudioRenderer::EnterPauseState() { |
| 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() on the source to make |
| + // sure that no more callback will get into the source. |
|
tommi (sloooow) - chröme
2014/03/04 20:48:39
nit:
// Stop the sink before calling RemoveAudioRe
no longer working on chromium
2014/03/05 13:01:04
Done.
|
| + sink_->Stop(); |
| + |
| { |
| base::AutoLock auto_lock(lock_); |
| if (state_ == UNINITIALIZED) |
| @@ -436,11 +443,6 @@ void WebRtcAudioRenderer::Stop() { |
| 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) { |