We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dee65d0 commit 8223b6fCopy full SHA for 8223b6f
1 file changed
qtBuildSystem/Mu/mainwindow.cpp
@@ -47,6 +47,7 @@ MainWindow::MainWindow(QWidget* parent) :
47
stateManager = new StateManager(this);
48
emuDebugger = new DebugViewer(this);
49
refreshDisplay = new QTimer(this);
50
+
51
audioDevice = new QAudioOutput(format, this);
52
audioOut = audioDevice->start();
53
@@ -226,7 +227,10 @@ void MainWindow::updateDisplay(){
226
227
ui->display->repaint();
228
229
//audio
- audioOut->write((const char*)emu.getAudioSamples(), AUDIO_SAMPLES_PER_FRAME * 2/*channels*/ * sizeof(int16_t));
230
+ if (audioOut != NULL) {
231
+ audioOut->write((const char*)emu.getAudioSamples(),
232
+ AUDIO_SAMPLES_PER_FRAME * 2/*channels*/ * sizeof(int16_t));
233
+ }
234
235
//power LED
236
ui->powerButtonLed->setStyleSheet(emu.getPowerButtonLed() ? "background: lime" : "");
0 commit comments