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

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

Issue 12440027: Do not pass the string device_id via IPC message to create an audio input stream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed Per's comments. 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
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 {
« no previous file with comments | « content/renderer/media/media_stream_dependency_factory.cc ('k') | content/renderer/media/webaudio_capturer_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698