13
0

PulseAudio: spin waiting for enough capacity to write

pa_threaded_mainloop_wait might wake up for several reasons. And there
is no point (but possibly harm) in moving on before we have verified
that PA actually is ready to receive our write without overflow.
This commit is contained in:
Mads Kiilerich 2022-10-30 21:08:52 +01:00 committed by Robin Gareus
parent 27a2bf1f59
commit 06b3d5ba33
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -1040,7 +1040,7 @@ PulseAudioBackend::main_process_thread ()
pa_threaded_mainloop_lock (p_mainloop); pa_threaded_mainloop_lock (p_mainloop);
size_t bytes_to_write = sizeof (float) * _samples_per_period * N_CHANNELS; size_t bytes_to_write = sizeof (float) * _samples_per_period * N_CHANNELS;
if (pa_stream_writable_size (p_stream) < bytes_to_write) { while (pa_stream_writable_size (p_stream) < bytes_to_write) {
/* wait until stream_request_cb triggers */ /* wait until stream_request_cb triggers */
pa_threaded_mainloop_wait (p_mainloop); pa_threaded_mainloop_wait (p_mainloop);
} }