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

Unified Diff: media/audio/audio_util.cc

Issue 10540034: Use 2 buffers on presumable good Windows boxes. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 6 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_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

Powered by Google App Engine
This is Rietveld 408576698