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

reimar subversion at mplayerhq.hu
Sat Dec 15 18:10:06 CET 2007


Author: reimar
Date: Sat Dec 15 18:10:06 2007
New Revision: 25414

Log:
pa_stream_write reportedly needs locking of the main loop
(could not find official documentation on this subject...)


Modified:
   trunk/libao2/ao_pulse.c

Modified: trunk/libao2/ao_pulse.c
==============================================================================
--- trunk/libao2/ao_pulse.c	(original)
+++ trunk/libao2/ao_pulse.c	Sat Dec 15 18:10:06 2007
@@ -256,10 +256,12 @@ static void uninit(int immed) {
 
 /** Play the specified data to the pulseaudio server */
 static int play(void* data, int len, int flags) {
+    pa_threaded_mainloop_lock(mainloop);
     if (pa_stream_write(stream, data, len, NULL, 0, PA_SEEK_RELATIVE) < 0) {
         GENERIC_ERR_MSG(context, "pa_stream_write() failed");
-        return -1;
+        len = -1;
     }
+    pa_threaded_mainloop_unlock(mainloop);
     return len;
 }
 



More information about the MPlayer-cvslog mailing list