diff --git a/xpcom/base/nsSystemInfo.cpp b/xpcom/base/nsSystemInfo.cpp index 224dfb78a39..3ffe96e9f49 100644 --- a/xpcom/base/nsSystemInfo.cpp +++ b/xpcom/base/nsSystemInfo.cpp @@ -31,6 +31,7 @@ #ifdef MOZ_WIDGET_GTK #include +#include #include #include #include "mozilla/Tokenizer.h" @@ -702,13 +703,33 @@ nsSystemInfo::Init() gtk_micro_version); } + nsAutoCString secondaryLibrary; if (gtkver_len > 0) { - rv = SetPropertyAsACString(NS_LITERAL_STRING("secondaryLibrary"), - nsDependentCSubstring(gtkver, gtkver_len)); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; + secondaryLibrary.Append(nsDependentCSubstring(gtkver, gtkver_len)); + } + + void* libpulse = dlopen("libpulse.so.0", RTLD_LAZY); + const char* libpulseVersion = "not-available"; + if (libpulse) { + auto pa_get_library_version = reinterpret_cast + (dlsym(libpulse, "pa_get_library_version")); + + if (pa_get_library_version) { + libpulseVersion = pa_get_library_version(); } } + + secondaryLibrary.AppendPrintf(",libpulse %s", libpulseVersion); + + if (libpulse) { + dlclose(libpulse); + } + + rv = SetPropertyAsACString(NS_LITERAL_STRING("secondaryLibrary"), + secondaryLibrary); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } #endif #ifdef MOZ_WIDGET_ANDROID