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

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: 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
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..cf4ad4fa8b34fecdb12f1a3a1335449879206b58 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,10 @@ void WebRtcLocalAudioTrack::SetCaptureFormat(
const media::AudioParameters& params) {
base::AutoLock auto_lock(lock_);
params_ = params;
+ // Update all the existing sinks with the new format.
henrika (OOO until Aug 14) 2013/05/07 09:13:27 nit, new line above comment
no longer working on chromium 2013/05/07 09:21:48 Done.
+ for (SinkList::const_iterator it = sinks_.begin();
+ it != sinks_.end(); ++it)
+ (*it)->SetCaptureFormat(params);
}
// webrtc::AudioTrackInterface implementation.

Powered by Google App Engine
This is Rietveld 408576698