From 63d71ba4ecf7322f24a96583933d451eee40013d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Thu, 11 Mar 2021 15:28:21 +0100 Subject: ao/pulse: signal the mainloop when ops are done Without the explicit signal the call to pa_threaded_mainloop_wait() will not return as soon as possible. Fixes 4f07607888541e6eb40fc5c3a1edfeb84aacb0f7 See #8633 --- audio/out/ao_pulse.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'audio/out') diff --git a/audio/out/ao_pulse.c b/audio/out/ao_pulse.c index fbfed79999..aa802e77a5 100644 --- a/audio/out/ao_pulse.c +++ b/audio/out/ao_pulse.c @@ -697,6 +697,7 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg) case AOCONTROL_SET_MUTE: case AOCONTROL_SET_VOLUME: { pa_threaded_mainloop_lock(priv->mainloop); + priv->retval = 0; uint32_t stream_index = pa_stream_get_index(priv->stream); if (cmd == AOCONTROL_SET_VOLUME) { const ao_control_vol_t *vol = arg; @@ -712,7 +713,8 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg) if (!waitop(priv, pa_context_set_sink_input_volume(priv->context, stream_index, &volume, - NULL, NULL))) { + context_success_cb, ao)) || + !priv->retval) { GENERIC_ERR_MSG("pa_context_set_sink_input_volume() failed"); return CONTROL_ERROR; } @@ -721,7 +723,8 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg) if (!waitop(priv, pa_context_set_sink_input_mute(priv->context, stream_index, *mute, - NULL, NULL))) { + context_success_cb, ao)) || + !priv->retval) { GENERIC_ERR_MSG("pa_context_set_sink_input_mute() failed"); return CONTROL_ERROR; } -- cgit v1.2.3