mirror of https://github.com/mgba-emu/mgba.git
Qt: Reset audio output when changing sample size
This commit is contained in:
parent
5c0c966a74
commit
20c5c27bf9
|
@ -59,8 +59,9 @@ void AudioProcessor::pause() {
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue