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

Unified Diff: chrome/browser/renderer_host/audio_renderer_host.cc

Issue 5350003: Move audio output number limit to AudioManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 10 years, 1 month 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 | « no previous file | media/audio/linux/audio_manager_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/audio_renderer_host.cc
diff --git a/chrome/browser/renderer_host/audio_renderer_host.cc b/chrome/browser/renderer_host/audio_renderer_host.cc
index 0d8d9e7508e19b8dc7ba2efc0ac0222c3efc1744..b18c4c3d1547a618426eccd39c8e63610bf44fc0 100644
--- a/chrome/browser/renderer_host/audio_renderer_host.cc
+++ b/chrome/browser/renderer_host/audio_renderer_host.cc
@@ -7,7 +7,6 @@
#include "base/metrics/histogram.h"
#include "base/process.h"
#include "base/shared_memory.h"
-#include "base/sys_info.h"
#include "chrome/browser/renderer_host/audio_sync_reader.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/render_messages_params.h"
@@ -26,34 +25,6 @@ static const int kMaxSamplesPerHardwarePacket = 64 * 1024;
// This value is selected so that we have 8192 samples for 48khz streams.
static const int kMillisecondsPerHardwarePacket = 170;
-// We allow at most 50 concurrent audio streams in most case. This is a
-// rather high limit that is practically hard to reach.
-static const size_t kMaxStreams = 50;
-
-// By experiment the maximum number of audio streams allowed in Leopard
-// is 18. But we put a slightly smaller number just to be safe.
-static const size_t kMaxStreamsLeopard = 15;
-
-// Returns the number of audio streams allowed. This is a practical limit to
-// prevent failure caused by too many audio streams opened.
-static size_t GetMaxAudioStreamsAllowed() {
-#if defined(OS_MACOSX)
- // We are hitting a bug in Leopard where too many audio streams will cause
- // a deadlock in the AudioQueue API when starting the stream. Unfortunately
- // there's no way to detect it within the AudioQueue API, so we put a
- // special hard limit only for Leopard.
- // See bug: http://crbug.com/30242
- int32 major, minor, bugfix;
- base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix);
- if (major < 10 || (major == 10 && minor <= 5))
- return kMaxStreamsLeopard;
-#endif
-
- // In OS other than OSX Leopard, the number of audio streams allowed is a
- // lot more so we return a separate number.
- return kMaxStreams;
-}
-
static uint32 SelectSamplesPerPacket(AudioParameters params) {
// Select the number of samples that can provide at least
// |kMillisecondsPerHardwarePacket| worth of audio data.
@@ -337,15 +308,6 @@ void AudioRendererHost::OnCreateStream(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(LookupById(msg.routing_id(), stream_id) == NULL);
- // Limit the number of audio streams opened. This is to prevent using
- // excessive resources for a large number of audio streams. More
- // importantly it prevents instability on certain systems.
- // See bug: http://crbug.com/30242
- if (audio_entries_.size() >= GetMaxAudioStreamsAllowed()) {
- SendErrorMessage(msg.routing_id(), stream_id);
- return;
- }
-
AudioParameters audio_params(params.params);
// Select the hardware packet size if not specified.
« no previous file with comments | « no previous file | media/audio/linux/audio_manager_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698