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

Side by Side Diff: media/audio/audio_util.cc

Issue 10823095: Merge 149119 to 1180 (M21) - Change NumberOfWaveOutBuffers() to return 3 for Windows >= Vista (inst… (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Software adjust volume of samples, allows each audio stream its own 5 // Software adjust volume of samples, allows each audio stream its own
6 // volume without impacting master volume for chrome and other applications. 6 // volume without impacting master volume for chrome and other applications.
7 7
8 // Implemented as templates to allow 8, 16 and 32 bit implementations. 8 // Implemented as templates to allow 8, 16 and 32 bit implementations.
9 // 8 bit is unsigned and biased by 128. 9 // 8 bit is unsigned and biased by 128.
10 10
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 // Note: that function correctly returns that Windows Server 2003 does not 518 // Note: that function correctly returns that Windows Server 2003 does not
519 // support WASAPI. 519 // support WASAPI.
520 return base::win::GetVersion() >= base::win::VERSION_VISTA; 520 return base::win::GetVersion() >= base::win::VERSION_VISTA;
521 } 521 }
522 522
523 int NumberOfWaveOutBuffers() { 523 int NumberOfWaveOutBuffers() {
524 // Simple heuristic: use 3 buffers on single-core system or on Vista, 524 // Simple heuristic: use 3 buffers on single-core system or on Vista,
525 // 2 otherwise. 525 // 2 otherwise.
526 // Entire Windows audio stack was rewritten for Windows Vista, and wave out 526 // Entire Windows audio stack was rewritten for Windows Vista, and wave out
527 // API is simulated on top of new API, so there is noticeable performance 527 // API is simulated on top of new API, so there is noticeable performance
528 // degradation compared to Windows XP. Part of regression was fixed in 528 // degradation compared to Windows XP. Part of regression was apparently fixed
529 // Windows 7. Maybe it is fixed in Vista Serice Pack, but let's be cautious. 529 // in Windows 7, but problems remain at least with some configurations.
530 if ((base::SysInfo::NumberOfProcessors() < 2) || 530 if ((base::SysInfo::NumberOfProcessors() < 2) ||
531 (base::win::GetVersion() == base::win::VERSION_VISTA)) { 531 (base::win::GetVersion() >= base::win::VERSION_VISTA)) {
532 return 3; 532 return 3;
533 } 533 }
534 return 2; 534 return 2;
535 } 535 }
536 536
537 #endif 537 #endif
538 538
539 } // namespace media 539 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698