pulse: do not die when a server hasn't been started. wait first.

This commit is contained in:
JohnHolmesII 2020-04-05 11:42:27 -07:00
parent 8e0f3c7ddf
commit 5c5031fd69
No known key found for this signature in database
GPG Key ID: 22B2A6E2C1E7D12C
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ waybar::modules::Pulseaudio::Pulseaudio(const std::string &id, const Json::Value
if (context_ == nullptr) {
throw std::runtime_error("pa_context_new() failed.");
}
if (pa_context_connect(context_, nullptr, PA_CONTEXT_NOAUTOSPAWN, nullptr) < 0) {
if (pa_context_connect(context_, nullptr, PA_CONTEXT_NOFAIL, nullptr) < 0) {
auto err =
fmt::format("pa_context_connect() failed: {}", pa_strerror(pa_context_errno(context_)));
throw std::runtime_error(err);