Fix pause/resume in PipeWireOut

This commit is contained in:
casey langen 2021-03-15 22:32:01 -07:00
parent a602b0efaf
commit 95564ef5cd

View File

@ -151,14 +151,31 @@ void PipeWireOut::Pause() {
std::unique_lock<std::recursive_mutex> lock(this->mutex);
this->bufferCondition.notify_all();
}
{
if (this->pwThreadLoop && this->pwStream) {
pw_thread_loop_lock(this->pwThreadLoop);
pw_stream_set_active(this->pwStream, false);
pw_thread_loop_unlock(this->pwThreadLoop);
}
}
}
void PipeWireOut::Resume() {
this->state = State::Playing;
{
std::unique_lock<std::recursive_mutex> lock(this->mutex);
this->bufferCondition.notify_all();
}
{
if (this->pwThreadLoop && this->pwStream) {
pw_thread_loop_lock(this->pwThreadLoop);
pw_stream_set_active(this->pwStream, true);
pw_thread_loop_unlock(this->pwThreadLoop);
}
}
}
void PipeWireOut::SetVolume(double volume) {