all repos — mgba @ 20c5c27bf91f8b38984fda4c74479cf449294012

mGBA Game Boy Advance Emulator

Qt: Reset audio output when changing sample size
Jeffrey Pfau jeffrey@endrift.com
Tue, 11 Nov 2014 01:25:46 -0800
commit

20c5c27bf91f8b38984fda4c74479cf449294012

parent

5c0c966a74d1913092b3ce706ad228443838d90b

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

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

@@ -59,8 +59,9 @@ }

void AudioProcessor::setBufferSamples(int samples) { if (m_audioOutput) { - QAudioFormat format = m_audioOutput->format(); - m_audioOutput->setBufferSize(samples * format.channelCount() * format.sampleSize() / 8); + m_audioOutput->stop(); + m_audioOutput->setBufferSize(samples * 4); + m_audioOutput->start(m_device); } }