[Linux/BSD] Add dynamically loaded library version checks.
This commit is contained in:
@ -169,6 +169,18 @@ Error AudioDriverALSA::init() {
|
||||
return ERR_CANT_OPEN;
|
||||
}
|
||||
#endif
|
||||
bool ver_ok = false;
|
||||
String version = String::utf8(snd_asoundlib_version());
|
||||
Vector<String> ver_parts = version.split(".");
|
||||
if (ver_parts.size() >= 2) {
|
||||
ver_ok = ((ver_parts[0].to_int() == 1 && ver_parts[1].to_int() >= 1)) || (ver_parts[0].to_int() > 1); // 1.1.0
|
||||
}
|
||||
print_verbose(vformat("ALSA %s detected.", version));
|
||||
if (!ver_ok) {
|
||||
print_verbose("Unsupported ALSA library version!");
|
||||
return ERR_CANT_OPEN;
|
||||
}
|
||||
|
||||
active.clear();
|
||||
exit_thread.clear();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user