[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

@ -290,6 +290,18 @@ Error AudioDriverPulseAudio::init() {
return ERR_CANT_OPEN;
}
#endif
bool ver_ok = false;
String version = String::utf8(pa_get_library_version());
Vector<String> ver_parts = version.split(".");
if (ver_parts.size() >= 2) {
ver_ok = (ver_parts[0].to_int() >= 8); // 8.0.0
}
print_verbose(vformat("PulseAudio %s detected.", version));
if (!ver_ok) {
print_verbose("Unsupported PulseAudio library version!");
return ERR_CANT_OPEN;
}
active.clear();
exit_thread.clear();