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

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

Issue 15031003: Fixed the crash when the WebRtcAudioCapturer::|buffer_| is NULL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the bots Created 7 years, 7 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 | « content/renderer/media/webrtc_audio_capturer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc_local_audio_track.cc
diff --git a/content/renderer/media/webrtc_local_audio_track.cc b/content/renderer/media/webrtc_local_audio_track.cc
index b277cad994288bfbb538d29dd41ffeba4ef21abe..398d8bd1544c2c836242eeaa4327c3701288b63b 100644
--- a/content/renderer/media/webrtc_local_audio_track.cc
+++ b/content/renderer/media/webrtc_local_audio_track.cc
@@ -30,7 +30,6 @@ WebRtcLocalAudioTrack::WebRtcLocalAudioTrack(
track_source_(track_source) {
DCHECK(capturer);
capturer_->AddSink(this);
- params_ = capturer_->audio_parameters();
DVLOG(1) << "WebRtcLocalAudioTrack::WebRtcLocalAudioTrack()";
}
@@ -72,6 +71,11 @@ void WebRtcLocalAudioTrack::SetCaptureFormat(
const media::AudioParameters& params) {
base::AutoLock auto_lock(lock_);
params_ = params;
+
+ // Update all the existing sinks with the new format.
+ for (SinkList::const_iterator it = sinks_.begin();
+ it != sinks_.end(); ++it)
+ (*it)->SetCaptureFormat(params);
}
// webrtc::AudioTrackInterface implementation.
« no previous file with comments | « content/renderer/media/webrtc_audio_capturer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698