Qt: Fix SDL audio crash

This commit is contained in:
Jeffrey Pfau 2016-02-13 01:17:17 -08:00
parent f3daa19a6d
commit b92482520c
1 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,10 @@
#include "LogController.h"
extern "C" {
#include "core/thread.h"
}
using namespace QGBA;
AudioProcessorSDL::AudioProcessorSDL(QObject* parent)
@ -21,7 +25,7 @@ AudioProcessorSDL::~AudioProcessorSDL() {
void AudioProcessorSDL::setInput(mCoreThread* input) {
AudioProcessor::setInput(input);
if (m_audio.core) {
if (m_audio.core && input->core != m_audio.core) {
mSDLDeinitAudio(&m_audio);
mSDLInitAudio(&m_audio, input);
}