Index: content/renderer/media/audio_track_recorder.cc |
diff --git a/content/renderer/media/audio_track_recorder.cc b/content/renderer/media/audio_track_recorder.cc |
index dea0c3deb144de9e57f2676863df2e53c75979a0..65457bb49ac90d3a8a630510122593acab002612 100644 |
--- a/content/renderer/media/audio_track_recorder.cc |
+++ b/content/renderer/media/audio_track_recorder.cc |
@@ -75,19 +75,6 @@ bool DoEncode(OpusEncoder* opus_encoder, |
return false; |
} |
-// Interleaves |audio_bus| channels() of floats into a single output linear |
-// |buffer|. |
-// TODO(mcasas) https://crbug.com/580391 use AudioBus::ToInterleavedFloat(). |
-void ToInterleaved(media::AudioBus* audio_bus, float* buffer) { |
- for (int ch = 0; ch < audio_bus->channels(); ++ch) { |
- const float* src = audio_bus->channel(ch); |
- const float* const src_end = src + audio_bus->frames(); |
- float* dest = buffer + ch; |
- for (; src < src_end; ++src, dest += audio_bus->channels()) |
- *dest = *src; |
- } |
-} |
- |
} // anonymous namespace |
// Nested class encapsulating opus-related encoding details. It contains an |
@@ -252,7 +239,8 @@ void AudioTrackRecorder::AudioEncoder::EncodeAudio( |
scoped_ptr<media::AudioBus> audio_bus = media::AudioBus::Create( |
output_params_.channels(), kOpusPreferredFramesPerBuffer); |
converter_->Convert(audio_bus.get()); |
- ToInterleaved(audio_bus.get(), buffer_.get()); |
+ audio_bus->ToInterleavedFloat(0, 0, audio_bus->frames(), |
+ buffer_.get()); |
scoped_ptr<std::string> encoded_data(new std::string()); |
if (DoEncode(opus_encoder_, buffer_.get(), kOpusPreferredFramesPerBuffer, |