[Linux/BSD] Add dynamically loaded library version checks.

This commit is contained in:
bruvzg
2023-03-16 10:44:47 +02:00
parent 161d028ae8
commit bed46f723c
9 changed files with 160 additions and 11 deletions

View File

@ -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();