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 4f07607888
See #8633
This commit is contained in:
Thomas Weißschuh 2021-03-11 15:28:21 +01:00 committed by Jan Ekström
parent d7f6eba233
commit 63d71ba4ec
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}