aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorJohannes Schickel2010-06-29 00:29:35 +0000
committerJohannes Schickel2010-06-29 00:29:35 +0000
commit5c424cfb41d439db5a0b3c00b7081473aa384ca6 (patch)
tree5c59d9d4a3f76aec2c7945b135643cfc3e4f91ae /base
parent876b6a50060bee23b4b05205a729014a8e5455b1 (diff)
downloadscummvm-rg350-5c424cfb41d439db5a0b3c00b7081473aa384ca6.tar.gz
scummvm-rg350-5c424cfb41d439db5a0b3c00b7081473aa384ca6.tar.bz2
scummvm-rg350-5c424cfb41d439db5a0b3c00b7081473aa384ca6.zip
Fix detection of invalid music drivers specified via command line.
Along with it documented that "0" is a special device handle for the invalid device. Now getDeviceHandle returns 0, when the identified device could not be found. Also getMusicType now returns MT_INVALID (newly introduced), when a non existing device was specified. svn-id: r50470
Diffstat (limited to 'base')
-rw-r--r--base/main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/base/main.cpp b/base/main.cpp
index a668c453d4..d40c912bf8 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -346,9 +346,9 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
// 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.contains("music-driver")) {
- 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";
+ if (MidiDriver::getMusicType(MidiDriver::getDeviceHandle(settings["music-driver"])) == MT_INVALID) {
+ warning("Unrecognized music driver '%s'. Switching to default device.", settings["music-driver"].c_str());
+ settings["music-driver"] = "auto";
}
}