diff options
Diffstat (limited to 'base/main.cpp')
-rw-r--r-- | base/main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/base/main.cpp b/base/main.cpp index 0360c89502..1e3edb1534 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -54,6 +54,7 @@ #include "gui/error.h" #include "sound/audiocd.h" +#include "sound/mididrv.h" #include "backends/keymapper/keymapper.h" @@ -341,6 +342,16 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { // Load the plugins. PluginManager::instance().loadPlugins(); + // If we received an invalid music parameter via command line we check this here. + // We can't check this before loading the music plugins. + // On the other hand we cannot load the plugins before we know the file paths (in case of external plugins). + if (!settings["music-driver"].empty()) { + if (MidiDriver::getMusicType(MidiDriver::getDeviceHandle(settings["music-driver"])) == MT_NULL) { + warning("Unrecognized music driver '%s'\nSwitching to default device.", settings["music-driver"].c_str()); + settings["music-driver"] = "auto"; + } + } + // Process the remaining command line settings. Must be done after the // config file and the plugins have been loaded. Common::Error res; |