Chromium Code Reviews| Index: media/audio/audio_util.cc |
| =================================================================== |
| --- media/audio/audio_util.cc (revision 140416) |
| +++ media/audio/audio_util.cc (working copy) |
| @@ -21,6 +21,7 @@ |
| #include "base/shared_memory.h" |
| #include "base/time.h" |
| #if defined(OS_WIN) |
| +#include "base/sys_info.h" |
| #include "base/win/windows_version.h" |
| #include "media/audio/audio_manager_base.h" |
| #endif |
| @@ -519,6 +520,17 @@ |
| return base::win::GetVersion() >= base::win::VERSION_VISTA; |
| } |
| +int NumberOfWaveOutBuffers() { |
| + // Simple heuristic: use 3 buffers on single-core system or on Vista, |
| + // 3 otherwise. |
|
scherkus (not reviewing)
2012/06/07 17:25:41
"use 3 buffers [...], 3 otherwise" ?
do you mean
enal1
2012/06/07 20:56:22
Done.
|
| + int num_buffers = 2; |
| + if ((base::SysInfo::NumberOfProcessors() < 2) || |
| + (base::win::GetVersion() == base::win::VERSION_VISTA)) { |
| + num_buffers = 3; |
| + } |
| + return num_buffers; |
|
scherkus (not reviewing)
2012/06/07 17:25:41
nit: how about dropping the num_buffers stuff and
enal1
2012/06/07 20:56:22
Done.
|
| +} |
| + |
| #endif |
| } // namespace media |