- made the sound font loading a bit more error resistant.

- implemented a fallback both for sound font lookup and for MIDI device selection so that if some non-working combination is set up, the player will fall back to something that works.
This commit is contained in:
Christoph Oelckers 2018-02-26 16:34:58 +01:00
commit eb124f6160
10 changed files with 77 additions and 35 deletions

View file

@ -390,6 +390,14 @@ const FSoundFontInfo *FSoundFontManager::FindSoundFont(const char *name, int all
return &sfi;
}
}
// We did not find what we were looking for. Let's just return the first valid item that works with the given device.
for (auto &sfi : soundfonts)
{
if (allowed & sfi.type)
{
return &sfi;
}
}
return nullptr;
}