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
This commit is contained in:
reimar 2009-04-09 20:07:26 +00:00
parent a7e4ab04d7
commit d1c4d6c7ef
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}