mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix SDL audio crash
This commit is contained in:
parent
f3daa19a6d
commit
b92482520c
|
@ -7,6 +7,10 @@
|
||||||
|
|
||||||
#include "LogController.h"
|
#include "LogController.h"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "core/thread.h"
|
||||||
|
}
|
||||||
|
|
||||||
using namespace QGBA;
|
using namespace QGBA;
|
||||||
|
|
||||||
AudioProcessorSDL::AudioProcessorSDL(QObject* parent)
|
AudioProcessorSDL::AudioProcessorSDL(QObject* parent)
|
||||||
|
@ -21,7 +25,7 @@ AudioProcessorSDL::~AudioProcessorSDL() {
|
||||||
|
|
||||||
void AudioProcessorSDL::setInput(mCoreThread* input) {
|
void AudioProcessorSDL::setInput(mCoreThread* input) {
|
||||||
AudioProcessor::setInput(input);
|
AudioProcessor::setInput(input);
|
||||||
if (m_audio.core) {
|
if (m_audio.core && input->core != m_audio.core) {
|
||||||
mSDLDeinitAudio(&m_audio);
|
mSDLDeinitAudio(&m_audio);
|
||||||
mSDLInitAudio(&m_audio, input);
|
mSDLInitAudio(&m_audio, input);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue