# HG changeset patch # User reimar # Date 1239307646 0 # Node ID 17c6a6c192a73efe519f1c8adec81710a2d7e4ae # Parent 010781e9229406ac4dbcd408b006a3b19397d87a Also lock the mainloop when doing adjusting the volume for PulseAudio. Patch by Lennart Poettering [lennart poettering net] diff -r 010781e92294 -r 17c6a6c192a7 libao2/ao_pulse.c --- a/libao2/ao_pulse.c Thu Apr 09 20:04:24 2009 +0000 +++ b/libao2/ao_pulse.c Thu Apr 09 20:07:26 2009 +0000 @@ -392,12 +392,15 @@ 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; }