all repos — mgba @ ddd8c8db29a1a7418626ade2ea35d432825579f3

mGBA Game Boy Advance Emulator

Make AudioDevice::setFormat thread-safe
Jeffrey Pfau jeffrey@endrift.com
Wed, 15 Oct 2014 04:48:18 -0700
commit

ddd8c8db29a1a7418626ade2ea35d432825579f3

parent

7353092b846bbe9032e418ec3fe9282e0ce5d9aa

1 files changed, 2 insertions(+), 1 deletions(-)

jump to
M src/platform/qt/AudioDevice.cppsrc/platform/qt/AudioDevice.cpp

@@ -19,8 +19,9 @@ void AudioDevice::setFormat(const QAudioFormat& format) {

if (!GBAThreadHasStarted(m_context)) { return; } - // TODO: make this thread-safe + GBAThreadInterrupt(m_context); m_ratio = GBAAudioCalculateRatio(&m_context->gba->audio, m_context->fpsTarget, format.sampleRate()); + GBAThreadContinue(m_context); } void AudioDevice::setInput(GBAThread* input) {