Index: content/renderer/media/media_stream_impl.cc |
diff --git a/content/renderer/media/media_stream_impl.cc b/content/renderer/media/media_stream_impl.cc |
index c9a225d32cdc54568a3794c96e679f310c5122b7..a184fe950934a5c1686ad08031941d88f0a4ab4b 100644 |
--- a/content/renderer/media/media_stream_impl.cc |
+++ b/content/renderer/media/media_stream_impl.cc |
@@ -128,12 +128,7 @@ void MediaStreamImpl::OnLocalMediaStreamStop( |
UserMediaRequestInfo* user_media_request = FindUserMediaRequestInfo(label); |
if (user_media_request) { |
- if (dependency_factory_->GetWebRtcAudioDevice()) { |
- scoped_refptr<WebRtcAudioCapturer> capturer = |
- dependency_factory_->GetWebRtcAudioDevice()->capturer(); |
- if (capturer) |
- capturer->Stop(); |
- } |
+ dependency_factory_->StopLocalAudioSource(user_media_request->descriptor); |
media_stream_dispatcher_->StopStream(label); |
DeleteUserMediaRequestInfo(user_media_request); |
@@ -495,6 +490,9 @@ void MediaStreamImpl::FrameWillClose(WebKit::WebFrame* frame) { |
// MediaStreamDispatcher know that the stream is no longer wanted. |
// If not, we cancel the request and delete the request object. |
if ((*request_it)->generated) { |
+ // Stop the local audio track before closing the device in the browser. |
+ dependency_factory_->StopLocalAudioSource((*request_it)->descriptor); |
+ |
media_stream_dispatcher_->StopStream( |
UTF16ToUTF8((*request_it)->descriptor.label())); |
} else { |