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

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

Issue 85523002: Fixed the crash in the wbaudio source provider when the audio track is going away. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: removed the comment. Created 7 years, 1 month 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 | « no previous file | Source/modules/webaudio/MediaStreamAudioSourceNode.h » ('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 508d8c941c023d35e407c291f9e1446681b15589..599113c3530c52d0c3471fa995abe5348f5f08f0 100644
--- a/Source/modules/webaudio/AudioContext.cpp
+++ b/Source/modules/webaudio/AudioContext.cpp
@@ -437,17 +437,18 @@ PassRefPtr<MediaStreamAudioSourceNode> AudioContext::createMediaStreamSource(Med
AudioSourceProvider* provider = 0;
MediaStreamTrackVector audioTracks = mediaStream->getAudioTracks();
+ RefPtr<MediaStreamTrack> audioTrack;
// 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];
- if (localAudio->component()->audioSourceProvider()) {
- provider = localAudio->component()->audioSourceProvider();
+ audioTrack = audioTracks[i];
+ if (audioTrack->component()->audioSourceProvider()) {
+ provider = audioTrack->component()->audioSourceProvider();
break;
}
}
- RefPtr<MediaStreamAudioSourceNode> node = MediaStreamAudioSourceNode::create(this, mediaStream, provider);
+ RefPtr<MediaStreamAudioSourceNode> node = MediaStreamAudioSourceNode::create(this, mediaStream, audioTrack.get(), provider);
// FIXME: Only stereo streams are supported right now. We should be able to accept multi-channel streams.
node->setFormat(2, sampleRate());
« no previous file with comments | « no previous file | Source/modules/webaudio/MediaStreamAudioSourceNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698