Increase the number of wave out buffers to 4 for Vista.

We found that, with Pepper plugins (e.g., Pepper Flash), even 50 ms buffers
weren't enough to avoid occasional clicks (with 3 wave out buffers). (On my
Vista test machine with 4 wave out buffers we could manage ~43 ms buffers.)

Review URL: https://chromiumcodereview.appspot.com/10830150

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149741 0039d316-1c4b-4281-b951-d872f2087c98
parent 41831be5
...@@ -542,17 +542,20 @@ bool IsWASAPISupported() { ...@@ -542,17 +542,20 @@ bool IsWASAPISupported() {
} }
int NumberOfWaveOutBuffers() { int NumberOfWaveOutBuffers() {
// Simple heuristic: use 3 buffers on single-core system or on Vista, // The entire Windows audio stack was rewritten for Windows Vista, and the
// 2 otherwise. // wave out API is simulated on top of new API, so there is noticeable
// Entire Windows audio stack was rewritten for Windows Vista, and wave out // performance degradation compared to Windows XP. So use 4 buffers for Vista.
// API is simulated on top of new API, so there is noticeable performance if (base::win::GetVersion() == base::win::VERSION_VISTA)
// degradation compared to Windows XP. Part of regression was apparently fixed return 4;
// in Windows 7, but problems remain at least with some configurations.
if ((base::SysInfo::NumberOfProcessors() < 2) || // Part of regression was apparently fixed in Windows 7, but problems remain
(base::win::GetVersion() >= base::win::VERSION_VISTA)) { // at least with some configurations (compared to XP). So use 3 buffers for
// Windows 7 and higher.
if (base::win::GetVersion() >= base::win::VERSION_WIN7)
return 3; return 3;
}
return 2; // Otherwise (for XP), use 3 buffers on single-core systems and 2 otherwise.
return (base::SysInfo::NumberOfProcessors() < 2) ? 3 : 2;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment