diff options
-rw-r--r-- | core/qmpmidioutfluid.cpp | 5 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpmainwindow.cpp | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/core/qmpmidioutfluid.cpp b/core/qmpmidioutfluid.cpp index 22f4aa2..621840e 100644 --- a/core/qmpmidioutfluid.cpp +++ b/core/qmpmidioutfluid.cpp @@ -85,6 +85,11 @@ void qmpMidiOutFluid::deviceInit() , this); if (!adriver) { + adriver = new_fluid_audio_driver(settings, synth); + output_level = 1e9 + 7; + } + if (!adriver) + { fputs("Error creating fluidsynth audio driver!", stderr); delete_fluid_synth(synth); synth = nullptr; diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp index 1c825ee..1198559 100644 --- a/qmidiplayer-desktop/qmpmainwindow.cpp +++ b/qmidiplayer-desktop/qmpmainwindow.cpp @@ -379,7 +379,7 @@ void qmpMainWindow::switchTrack(QString s, bool interrupt) { player->playerThread(); if (settings->getOptionBool("Midi/WaitVoice") && player->isFinished()) - while (internalfluid->getOutputLevel() > -100) + while (internalfluid->getOutputLevel() > -100 && internalfluid->getPolyphone() > 0) std::this_thread::sleep_for(std::chrono::milliseconds(10)); }); #ifdef _WIN32 @@ -534,7 +534,7 @@ void qmpMainWindow::on_pbPlayPause_clicked() { player->playerThread(); if (settings->getOptionBool("Midi/WaitVoice") && player->isFinished()) - while (internalfluid->getOutputLevel() > -100) + while (internalfluid->getOutputLevel() > -100 && internalfluid->getPolyphone() > 0) std::this_thread::sleep_for(std::chrono::milliseconds(10)); }); #ifdef _WIN32 |