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

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
« no previous file with comments | « media/audio/audio_util.h ('k') | media/audio/win/audio_manager_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_util.cc
===================================================================
--- media/audio/audio_util.cc (revision 142383)
+++ 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,20 @@
return base::win::GetVersion() >= base::win::VERSION_VISTA;
}
+int NumberOfWaveOutBuffers() {
+ // Simple heuristic: use 3 buffers on single-core system or on Vista,
+ // 2 otherwise.
+ // Entire Windows audio stack was rewritten for Windows Vista, and wave out
+ // API is simulated on top of new API, so there is noticeable performance
+ // degradation compared to Windows XP. Part of regression was fixed in
+ // Windows 7. Maybe it is fixed in Vista Serice Pack, but let's be cautious.
+ if ((base::SysInfo::NumberOfProcessors() < 2) ||
+ (base::win::GetVersion() == base::win::VERSION_VISTA)) {
+ return 3;
+ }
+ return 2;
+}
+
#endif
} // namespace media
« no previous file with comments | « media/audio/audio_util.h ('k') | media/audio/win/audio_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698