mirror of https://github.com/mgba-emu/mgba.git
Make AudioDevice::setFormat thread-safe
This commit is contained in:
parent
7353092b84
commit
ddd8c8db29
|
@ -19,8 +19,9 @@ void AudioDevice::setFormat(const QAudioFormat& format) {
|
||||||
if (!GBAThreadHasStarted(m_context)) {
|
if (!GBAThreadHasStarted(m_context)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// TODO: make this thread-safe
|
GBAThreadInterrupt(m_context);
|
||||||
m_ratio = GBAAudioCalculateRatio(&m_context->gba->audio, m_context->fpsTarget, format.sampleRate());
|
m_ratio = GBAAudioCalculateRatio(&m_context->gba->audio, m_context->fpsTarget, format.sampleRate());
|
||||||
|
GBAThreadContinue(m_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioDevice::setInput(GBAThread* input) {
|
void AudioDevice::setInput(GBAThread* input) {
|
||||||
|
|
Loading…
Reference in New Issue