summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-04-09 20:07:26 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-04-09 20:07:26 +0000
commitd1c4d6c7ef3625d6b2668a44406db832836d525c (patch)
tree05735dbbb9132e660625f657bba0f4b649b1286f
parenta7e4ab04d7e714c572767e58b409a48ed46b862f (diff)
downloadmpv-d1c4d6c7ef3625d6b2668a44406db832836d525c.tar.bz2
mpv-d1c4d6c7ef3625d6b2668a44406db832836d525c.tar.xz
Also lock the mainloop when doing adjusting the volume for PulseAudio.
Patch by Lennart Poettering [lennart poettering net] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29158 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libao2/ao_pulse.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libao2/ao_pulse.c b/libao2/ao_pulse.c
index 66d28aa281..83270bbfcf 100644
--- a/libao2/ao_pulse.c
+++ b/libao2/ao_pulse.c
@@ -392,12 +392,15 @@ static int control(int cmd, void *arg) {
volume.values[1] = (pa_volume_t)vol->right*PA_VOLUME_NORM/100;
}
+ pa_threaded_mainloop_lock(mainloop);
if (!(o = pa_context_set_sink_input_volume(context, pa_stream_get_index(stream), &volume, NULL, NULL))) {
+ pa_threaded_mainloop_unlock(mainloop);
GENERIC_ERR_MSG(context, "pa_context_set_sink_input_volume() failed");
return CONTROL_ERROR;
}
/* We don't wait for completion here */
pa_operation_unref(o);
+ pa_threaded_mainloop_unlock(mainloop);
return CONTROL_OK;
}