Make pa_ready thread safe

This commit is contained in:
badaix 2020-11-26 10:41:24 +01:00
parent 21665d163e
commit f08d3be836
2 changed files with 3 additions and 1 deletions

View file

@ -264,6 +264,7 @@ void PulsePlayer::start()
throw SnapException("Timeout while waiting for PulseAudio to become ready");
if (pa_mainloop_iterate(pa_ml_, 1, nullptr) < 0)
throw SnapException("Error while waiting for PulseAudio to become ready: " + std::string(pa_strerror(pa_context_errno(pa_ctx_))));
this_thread::sleep_for(1ms);
}
if (pa_ready_ == 2)