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

Unified Diff: Source/modules/webaudio/AudioContext.cpp

Issue 13982022: MediaStream API: Removing LocalMediaStream (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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 | « Source/modules/modules.gypi ('k') | Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioContext.cpp
diff --git a/Source/modules/webaudio/AudioContext.cpp b/Source/modules/webaudio/AudioContext.cpp
index bd7d0566d86ac06e4719963e2966cd541c52762b..46d1916333c40de4a5cda8fd055e05c457b71cb5 100644
--- a/Source/modules/webaudio/AudioContext.cpp
+++ b/Source/modules/webaudio/AudioContext.cpp
@@ -385,15 +385,16 @@ PassRefPtr<MediaStreamAudioSourceNode> AudioContext::createMediaStreamSource(Med
AudioSourceProvider* provider = 0;
MediaStreamTrackVector audioTracks = mediaStream->getAudioTracks();
- if (mediaStream->isLocal() && audioTracks.size()) {
- // Enable input for the specific local audio device specified in the MediaStreamSource.
- RefPtr<MediaStreamTrack> localAudio = audioTracks[0];
+
+ // FIXME: get a provider for non-local MediaStreams (like from a remote peer).
+ for (size_t i = 0; i < audioTracks.size(); ++i) {
+ RefPtr<MediaStreamTrack> localAudio = audioTracks[i];
MediaStreamSource* source = localAudio->component()->source();
- destination()->enableInput(source->deviceId());
- provider = destination()->localAudioInputProvider();
- } else {
- // FIXME: get a provider for non-local MediaStreams (like from a remote peer).
- provider = 0;
+ if (!source->deviceId().isEmpty()) {
+ destination()->enableInput(source->deviceId());
+ provider = destination()->localAudioInputProvider();
+ break;
+ }
}
RefPtr<MediaStreamAudioSourceNode> node = MediaStreamAudioSourceNode::create(this, mediaStream, provider);
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698