[MPlayer-cvslog] r29158 - trunk/libao2/ao_pulse.c

reimar subversion at mplayerhq.hu
Thu Apr 9 22:07:26 CEST 2009


Author: reimar
Date: Thu Apr  9 22:07:26 2009
New Revision: 29158

Log:
Also lock the mainloop when doing adjusting the volume for PulseAudio.
Patch by Lennart Poettering [lennart poettering net]

Modified:
   trunk/libao2/ao_pulse.c

Modified: trunk/libao2/ao_pulse.c
==============================================================================
--- trunk/libao2/ao_pulse.c	Thu Apr  9 22:04:24 2009	(r29157)
+++ trunk/libao2/ao_pulse.c	Thu Apr  9 22:07:26 2009	(r29158)
@@ -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;
         }
 


More information about the MPlayer-cvslog mailing list