mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Move mixer construction to AudioCommon.cpp.
This commit is contained in:
parent
aac4206664
commit
102ea55f20
@ -26,8 +26,13 @@ SoundStream *soundStream = nullptr;
|
||||
|
||||
namespace AudioCommon
|
||||
{
|
||||
SoundStream *InitSoundStream(CMixer *mixer, void *hWnd)
|
||||
SoundStream *InitSoundStream(void *hWnd)
|
||||
{
|
||||
unsigned int AISampleRate, DACSampleRate;
|
||||
AudioInterface::Callback_GetSampleRate(AISampleRate, DACSampleRate);
|
||||
delete soundStream;
|
||||
CMixer *mixer = new CMixer(AISampleRate, DACSampleRate, 48000);
|
||||
|
||||
// TODO: possible memleak with mixer
|
||||
|
||||
std::string backend = SConfig::GetInstance().sBackend;
|
||||
|
@ -14,7 +14,7 @@ extern SoundStream *soundStream;
|
||||
|
||||
namespace AudioCommon
|
||||
{
|
||||
SoundStream *InitSoundStream(CMixer *mixer, void *hWnd);
|
||||
SoundStream *InitSoundStream(void *hWnd);
|
||||
void ShutdownSoundStream();
|
||||
std::vector<std::string> GetSoundBackends();
|
||||
bool UseJIT();
|
||||
|
@ -262,10 +262,7 @@ void DSPHLE::DSP_WriteMailBoxLow(bool _CPUMailbox, unsigned short _Value)
|
||||
|
||||
void DSPHLE::InitMixer()
|
||||
{
|
||||
unsigned int AISampleRate, DACSampleRate;
|
||||
AudioInterface::Callback_GetSampleRate(AISampleRate, DACSampleRate);
|
||||
delete soundStream;
|
||||
soundStream = AudioCommon::InitSoundStream(new CMixer(AISampleRate, DACSampleRate, 48000), m_hWnd);
|
||||
soundStream = AudioCommon::InitSoundStream(m_hWnd);
|
||||
if (!soundStream) PanicAlert("Error starting up sound stream");
|
||||
// Mixer is initialized
|
||||
m_InitMixer = true;
|
||||
|
@ -181,10 +181,7 @@ void DSPLLE::Shutdown()
|
||||
|
||||
void DSPLLE::InitMixer()
|
||||
{
|
||||
unsigned int AISampleRate, DACSampleRate;
|
||||
AudioInterface::Callback_GetSampleRate(AISampleRate, DACSampleRate);
|
||||
delete soundStream;
|
||||
soundStream = AudioCommon::InitSoundStream(new CMixer(AISampleRate, DACSampleRate, 48000), m_hWnd);
|
||||
soundStream = AudioCommon::InitSoundStream(m_hWnd);
|
||||
if (!soundStream) PanicAlert("Error starting up sound stream");
|
||||
// Mixer is initialized
|
||||
m_InitMixer = true;
|
||||
|
Loading…
Reference in New Issue
Block a user