mirror of https://github.com/mpv-player/mpv
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:
parent
d7f6eba233
commit
63d71ba4ec
|
@ -697,6 +697,7 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg)
|
||||||
case AOCONTROL_SET_MUTE:
|
case AOCONTROL_SET_MUTE:
|
||||||
case AOCONTROL_SET_VOLUME: {
|
case AOCONTROL_SET_VOLUME: {
|
||||||
pa_threaded_mainloop_lock(priv->mainloop);
|
pa_threaded_mainloop_lock(priv->mainloop);
|
||||||
|
priv->retval = 0;
|
||||||
uint32_t stream_index = pa_stream_get_index(priv->stream);
|
uint32_t stream_index = pa_stream_get_index(priv->stream);
|
||||||
if (cmd == AOCONTROL_SET_VOLUME) {
|
if (cmd == AOCONTROL_SET_VOLUME) {
|
||||||
const ao_control_vol_t *vol = arg;
|
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,
|
if (!waitop(priv, pa_context_set_sink_input_volume(priv->context,
|
||||||
stream_index,
|
stream_index,
|
||||||
&volume,
|
&volume,
|
||||||
NULL, NULL))) {
|
context_success_cb, ao)) ||
|
||||||
|
!priv->retval) {
|
||||||
GENERIC_ERR_MSG("pa_context_set_sink_input_volume() failed");
|
GENERIC_ERR_MSG("pa_context_set_sink_input_volume() failed");
|
||||||
return CONTROL_ERROR;
|
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,
|
if (!waitop(priv, pa_context_set_sink_input_mute(priv->context,
|
||||||
stream_index,
|
stream_index,
|
||||||
*mute,
|
*mute,
|
||||||
NULL, NULL))) {
|
context_success_cb, ao)) ||
|
||||||
|
!priv->retval) {
|
||||||
GENERIC_ERR_MSG("pa_context_set_sink_input_mute() failed");
|
GENERIC_ERR_MSG("pa_context_set_sink_input_mute() failed");
|
||||||
return CONTROL_ERROR;
|
return CONTROL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue