diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-24 23:04:56 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-24 23:04:56 +0000 |
commit | febe94524deeb320646d623cd91ed87e1db67a7b (patch) | |
tree | 37324c7aa5ba6d115c42e60a335476be64e70f19 /media/audio/win | |
parent | 0ca7e535e2f0b093158c0e73393eead0e1842f6f (diff) | |
download | chromium_src-febe94524deeb320646d623cd91ed87e1db67a7b.zip chromium_src-febe94524deeb320646d623cd91ed87e1db67a7b.tar.gz chromium_src-febe94524deeb320646d623cd91ed87e1db67a7b.tar.bz2 |
Share one thread between all AudioOutputControllers instead of creating one per stream.
TEST=unittests
BUG=39825
Review URL: http://codereview.chromium.org/3185022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57254 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/win')
-rw-r--r-- | media/audio/win/audio_manager_win.cc | 17 | ||||
-rw-r--r-- | media/audio/win/audio_manager_win.h | 4 |
2 files changed, 5 insertions, 16 deletions
diff --git a/media/audio/win/audio_manager_win.cc b/media/audio/win/audio_manager_win.cc index 061d2d8..6c4a606 100644 --- a/media/audio/win/audio_manager_win.cc +++ b/media/audio/win/audio_manager_win.cc @@ -7,7 +7,6 @@ #include <windows.h> #include <mmsystem.h> -#include "base/at_exit.h" #include "base/basictypes.h" #include "media/audio/fake_audio_input_stream.h" #include "media/audio/fake_audio_output_stream.h" @@ -42,8 +41,6 @@ const int kMaxSamplesPerPacket = kMaxSampleRate; // play. const int kNumInputBuffers = 3; -AudioManagerWin* g_audio_manager = NULL; - } // namespace. bool AudioManagerWin::HasAudioOutputDevices() { @@ -125,15 +122,7 @@ void AudioManagerWin::UnMuteAll() { AudioManagerWin::~AudioManagerWin() { } -void DestroyAudioManagerWin(void* param) { - delete g_audio_manager; - g_audio_manager = NULL; -} - -AudioManager* AudioManager::GetAudioManager() { - if (!g_audio_manager) { - g_audio_manager = new AudioManagerWin(); - base::AtExitManager::RegisterCallback(&DestroyAudioManagerWin, NULL); - } - return g_audio_manager; +// static +AudioManager* AudioManager::CreateAudioManager() { + return new AudioManagerWin(); } diff --git a/media/audio/win/audio_manager_win.h b/media/audio/win/audio_manager_win.h index 21a4014..b8bd579 100644 --- a/media/audio/win/audio_manager_win.h +++ b/media/audio/win/audio_manager_win.h @@ -8,7 +8,7 @@ #include <windows.h> #include "base/basictypes.h" -#include "media/audio/audio_io.h" +#include "media/audio/audio_manager_base.h" class PCMWaveInAudioInputStream; class PCMWaveOutAudioOutputStream; @@ -16,7 +16,7 @@ class PCMWaveOutAudioOutputStream; // Windows implementation of the AudioManager singleton. This class is internal // to the audio output and only internal users can call methods not exposed by // the AudioManager class. -class AudioManagerWin : public AudioManager { +class AudioManagerWin : public AudioManagerBase { public: AudioManagerWin() {} // Implementation of AudioManager. |