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

Unified Diff: media/audio/mac/audio_low_latency_input_mac.cc

Issue 12316131: Moved AudioUtil static functions to AudioManager interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the bots. Created 7 years, 10 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/mac/audio_low_latency_input_mac.cc
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
index 85eef1fb50b8e0b62c46935cbc76abecef824ae0..d443d4443f683c52c568c3ac52d0ea53e7d3db9c 100644
--- a/media/audio/mac/audio_low_latency_input_mac.cc
+++ b/media/audio/mac/audio_low_latency_input_mac.cc
@@ -67,7 +67,9 @@ AUAudioInputStream::AUAudioInputStream(
// Note that we use the same native buffer size as for the output side here
// since the AUHAL implementation requires that both capture and render side
// use the same buffer size. See http://crbug.com/154352 for more details.
- number_of_frames_ = GetAudioHardwareBufferSize();
+ const AudioParameters parameters =
+ manager_->GetInputStreamParameters(input_device_id_);
+ number_of_frames_ = parameters.frames_per_buffer();
DVLOG(1) << "Size of data buffer in frames : " << number_of_frames_;
// Derive size (in bytes) of the buffers that we will render to.
@@ -225,7 +227,8 @@ bool AUAudioInputStream::Open() {
// Set the desired number of frames in the IO buffer (output scope).
// WARNING: Setting this value changes the frame size for all audio units in
// the current process. It's imperative that the input and output frame sizes
- // be the same as audio_util::GetAudioHardwareBufferSize().
+ // be the same as the frames_per_buffer() returned by
+ // GetInputStreamParameters().
// TODO(henrika): Due to http://crrev.com/159666 this is currently not true
// and should be fixed, a CHECK() should be added at that time.
result = AudioUnitSetProperty(audio_unit_,

Powered by Google App Engine
This is Rietveld 408576698