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

Unified Diff: media/filters/audio_renderer_impl.cc

Issue 10824304: Upgrade AudioBus to support wrapping, interleaving. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 4 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: media/filters/audio_renderer_impl.cc
diff --git a/media/filters/audio_renderer_impl.cc b/media/filters/audio_renderer_impl.cc
index 948e68833fbf8a68d0588eba50cf0a9b25f3d13c..94ee20f7145fb35e5f650eab18461af55c7cc5b7 100644
--- a/media/filters/audio_renderer_impl.cc
+++ b/media/filters/audio_renderer_impl.cc
@@ -352,23 +352,10 @@ int AudioRendererImpl::Render(AudioBus* audio_bus,
DCHECK_LE(bytes_filled, buf_size);
UpdateEarliestEndTime(bytes_filled, request_delay, base::Time::Now());
- // Deinterleave each audio channel.
- int channels = audio_bus->channels();
- for (int channel_index = 0; channel_index < channels; ++channel_index) {
- media::DeinterleaveAudioChannel(buf.get(),
- audio_bus->channel(channel_index),
- channels,
- channel_index,
- bytes_per_frame / channels,
- frames_filled);
-
- // If FillBuffer() didn't give us enough data then zero out the remainder.
- if (frames_filled < audio_bus->frames()) {
- int frames_to_zero = audio_bus->frames() - frames_filled;
- memset(audio_bus->channel(channel_index) + frames_filled, 0,
- sizeof(*audio_bus->channel(channel_index)) * frames_to_zero);
- }
- }
+ // Deinterleave audio data into the output bus.
+ audio_bus->FromInterleaved(
+ buf.get(), frames_filled, audio_parameters_.bits_per_sample() / 8);
+
return frames_filled;
}

Powered by Google App Engine
This is Rietveld 408576698