From d1c4d6c7ef3625d6b2668a44406db832836d525c Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 9 Apr 2009 20:07:26 +0000 Subject: 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 --- libao2/ao_pulse.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- cgit v1.2.3