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

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

Issue 236123002: Allow pass through buffer sizes on OSX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Rebase. Created 6 years, 8 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_manager_mac.cc
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
index 60c8a3e7a6cbe5b4aafd98902e0b30462254a914..9908a0e330b6e3d1cd1dc73597e77c0874d88363 100644
--- a/media/audio/mac/audio_manager_mac.cc
+++ b/media/audio/mac/audio_manager_mac.cc
@@ -672,7 +672,13 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
const bool has_valid_input_params = input_params.IsValid();
const int hardware_sample_rate = HardwareSampleRateForDevice(device);
- const int buffer_size = ChooseBufferSize(hardware_sample_rate);
+
+ // Allow pass through buffer sizes. If concurrent input and output streams
+ // exist, they will use the smallest buffer size amongst them. As such, each
+ // stream must be able to FIFO requests appropriately when this happens.
+ int buffer_size = ChooseBufferSize(hardware_sample_rate);
+ if (has_valid_input_params)
+ buffer_size = std::max(input_params.frames_per_buffer(), buffer_size);
int hardware_channels;
if (!GetDeviceChannels(device, kAudioDevicePropertyScopeOutput,

Powered by Google App Engine
This is Rietveld 408576698