| Index: content/renderer/media/webrtc_audio_capturer.cc
|
| diff --git a/content/renderer/media/webrtc_audio_capturer.cc b/content/renderer/media/webrtc_audio_capturer.cc
|
| index 7486e083ccda1410968b7a32d34f30b8ded4b2b8..5d64781e61cba2fab8696e1141ce90840ca6cdc3 100644
|
| --- a/content/renderer/media/webrtc_audio_capturer.cc
|
| +++ b/content/renderer/media/webrtc_audio_capturer.cc
|
| @@ -113,9 +113,34 @@ void WebRtcAudioCapturer::SetCapturerSource(
|
| }
|
|
|
| // Detach the old source from normal recording.
|
| - if (old_source)
|
| + if (old_source) {
|
| old_source->Stop();
|
|
|
| + // TODO(henrika, crogers): I have hard coded parameters given knowledge
|
| + // of a file source (44.1kHz, mono) here and use these parameters to reset
|
| + // our member parameters. I then dispatch the new parameters both to the
|
| + // sink(s) and to the new source. The idea is to get rid of any dependency
|
| + // of the microphone parameters which are uses as base otherwise.
|
| +
|
| + // I guess we could add this info to AudioCapturerSource to enable a
|
| + // query here. E.g.:
|
| +
|
| + // source->ModifyAudioParameters(¶ms_);
|
| +
|
| + params_.Reset(params_.format(),
|
| + media::CHANNEL_LAYOUT_MONO, // <-- get this from WebKit?
|
| + 44100, // <-- get this from WebKit?
|
| + 16, // <-- get this from WebKit?
|
| + 440); // requires knowledge about WebRTC @ 10ms
|
| +
|
| + buffer_.reset(new int16[params_.frames_per_buffer() * params_.channels()]);
|
| +
|
| + for (SinkList::const_iterator it = sinks_.begin();
|
| + it != sinks_.end(); ++it) {
|
| + (*it)->SetCaptureFormat(params_);
|
| + }
|
| + }
|
| +
|
| if (source)
|
| source->Initialize(params_, this, this);
|
| }
|
|
|