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

Unified Diff: media/audio/audio_device_thread.cc

Issue 10832285: Switch OnMoreData() to use AudioBus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. 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/audio/audio_device_thread.cc
diff --git a/media/audio/audio_device_thread.cc b/media/audio/audio_device_thread.cc
index 3e14d3de53929ae88488fe03fc200c325529ca89..a724b2146d2d2fcf21c4c4f2c36ebb94cafbf615 100644
--- a/media/audio/audio_device_thread.cc
+++ b/media/audio/audio_device_thread.cc
@@ -197,9 +197,9 @@ void AudioDeviceThread::Callback::InitializeOnAudioThread() {
MapSharedMemory();
DCHECK(shared_memory_.memory() != NULL);
- // TODO(dalecurtis): Instead of creating a new AudioBus and memcpy'ing into
- // the shared memory we should wrap the shared memory.
- audio_bus_ = AudioBus::Create(audio_parameters_);
+ DCHECK_EQ(memory_length_,
+ media::AudioBus::CalculateMemorySize(audio_parameters_));
+ audio_bus_ = AudioBus::WrapMemory(audio_parameters_, shared_memory_.memory());
}
} // namespace media.

Powered by Google App Engine
This is Rietveld 408576698