From ef5b29c6ddb6743c08fdf7a3647e6c1d290acbe6 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Sun, 30 Oct 2022 21:05:02 +0100 Subject: [PATCH] PulseAudio: group operations and their verification together Improves readability a bit. IMO. --- libs/backends/pulseaudio/pulseaudio_backend.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/backends/pulseaudio/pulseaudio_backend.cc b/libs/backends/pulseaudio/pulseaudio_backend.cc index c4a4bb0e7e..27d21c4293 100644 --- a/libs/backends/pulseaudio/pulseaudio_backend.cc +++ b/libs/backends/pulseaudio/pulseaudio_backend.cc @@ -274,7 +274,6 @@ PulseAudioBackend::init_pulse () close_pulse (true); return AudioDeviceOpenError; } - /* Wait until the context is ready, context_state_cb will trigger this */ pa_threaded_mainloop_wait (p_mainloop); if (pa_context_get_state (p_context) != PA_CONTEXT_READY) { @@ -318,10 +317,8 @@ PulseAudioBackend::init_pulse () close_pulse (true); return AudioDeviceOpenError; } - /* Wait until the stream is ready */ pa_threaded_mainloop_wait (p_mainloop); - if (pa_stream_get_state (p_stream) != PA_STREAM_READY) { PBD::error << _("PulseAudioBackend: Failed to start stream") << endmsg; close_pulse (true); @@ -1084,6 +1081,7 @@ PulseAudioBackend::main_process_thread () PBD::error << _("PulseAudioBackend::main_process_thread pa_stream_write failed.") << endmsg; break; } + pa_threaded_mainloop_unlock (p_mainloop); _processed_samples += _samples_per_period;