summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas@t-8ch.de>2021-03-11 15:28:21 +0100
committerJan Ekström <jeebjp@gmail.com>2021-03-11 23:37:13 +0200
commit63d71ba4ecf7322f24a96583933d451eee40013d (patch)
treefc4dea6b808ef700ec65d54c95c5c86598c19159 /audio
parentd7f6eba233369904ab1fa1ccd0f943bcf2fbc6e9 (diff)
downloadmpv-63d71ba4ecf7322f24a96583933d451eee40013d.tar.bz2
mpv-63d71ba4ecf7322f24a96583933d451eee40013d.tar.xz
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
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao_pulse.c7
1 files changed, 5 insertions, 2 deletions
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;
}