diff options
| author | Lioncash <mathew1800@gmail.com> | 2015-05-24 04:13:02 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2015-05-24 05:49:41 -0400 |
| commit | 35ee8a136237042efa6987e954c135f91a065cd0 (patch) | |
| tree | d84a20d521f2a3eb8a4f4ecaca95d577798e294e /Source/Core/AudioCommon/AudioCommon.cpp | |
| parent | a6e5fd1e27385bb68844584927d45ec32b99eb55 (diff) | |
SoundStream: Internally construct the mixer
Instead of creating the mixer externally and then passing it in, it can just be made within the class.
Diffstat (limited to 'Source/Core/AudioCommon/AudioCommon.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/AudioCommon.cpp | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp index 5ea79319de..e60b988547 100644 --- a/Source/Core/AudioCommon/AudioCommon.cpp +++ b/Source/Core/AudioCommon/AudioCommon.cpp @@ -32,38 +32,34 @@ namespace AudioCommon SoundStream* InitSoundStream() { - CMixer *mixer = new CMixer(48000); - - // TODO: possible memleak with mixer - std::string backend = SConfig::GetInstance().sBackend; - if (backend == BACKEND_OPENAL && OpenALStream::isValid()) - g_sound_stream = new OpenALStream(mixer); - else if (backend == BACKEND_NULLSOUND && NullSound::isValid()) - g_sound_stream = new NullSound(mixer); + if (backend == BACKEND_OPENAL && OpenALStream::isValid()) + g_sound_stream = new OpenALStream(); + else if (backend == BACKEND_NULLSOUND && NullSound::isValid()) + g_sound_stream = new NullSound(); else if (backend == BACKEND_XAUDIO2) { if (XAudio2::isValid()) - g_sound_stream = new XAudio2(mixer); + g_sound_stream = new XAudio2(); else if (XAudio2_7::isValid()) - g_sound_stream = new XAudio2_7(mixer); + g_sound_stream = new XAudio2_7(); } - else if (backend == BACKEND_AOSOUND && AOSound::isValid()) - g_sound_stream = new AOSound(mixer); - else if (backend == BACKEND_ALSA && AlsaSound::isValid()) - g_sound_stream = new AlsaSound(mixer); - else if (backend == BACKEND_COREAUDIO && CoreAudioSound::isValid()) - g_sound_stream = new CoreAudioSound(mixer); - else if (backend == BACKEND_PULSEAUDIO && PulseAudio::isValid()) - g_sound_stream = new PulseAudio(mixer); + else if (backend == BACKEND_AOSOUND && AOSound::isValid()) + g_sound_stream = new AOSound(); + else if (backend == BACKEND_ALSA && AlsaSound::isValid()) + g_sound_stream = new AlsaSound(); + else if (backend == BACKEND_COREAUDIO && CoreAudioSound::isValid()) + g_sound_stream = new CoreAudioSound(); + else if (backend == BACKEND_PULSEAUDIO && PulseAudio::isValid()) + g_sound_stream = new PulseAudio(); else if (backend == BACKEND_OPENSLES && OpenSLESStream::isValid()) - g_sound_stream = new OpenSLESStream(mixer); + g_sound_stream = new OpenSLESStream(); if (!g_sound_stream && NullSound::isValid()) { WARN_LOG(DSPHLE, "Could not initialize backend %s, using %s instead.", backend.c_str(), BACKEND_NULLSOUND); - g_sound_stream = new NullSound(mixer); + g_sound_stream = new NullSound(); } if (g_sound_stream) |
